Skip to content

Schema is not fetched after repository branch is changed #449

@AlessioDiama

Description

@AlessioDiama

Changing the spec.repositories.ref from one branch to another, seems to have any effect on the fetched schema.
An example to reproduce:

  • Create a schema with a reference to an existing branch:
kubectl get schema -n sdc-system pcc-1.40
NAME       READY   PROVIDER                 VERSION   URL                                                                              REF
pcc-1.40   True    pcc.ericsson.sdcio.dev   1.40      https://code.swisscom.com/...   main
  • Change the reference to a non existing branch:
  • The schema is still ready and no errors are reported
kubectl get schema -n sdc-system pcc-1.40
NAME       READY   PROVIDER                 VERSION   URL                                                                              REF
pcc-1.40   True    pcc.ericsson.sdcio.dev   1.40      https://code.swisscom.com/...   non-existing-branch

Deleting and recreating the schema brings the expected error:

kubectl get schema -n sdc-system pcc-1.40  -o yaml
apiVersion: inv.sdcio.dev/v1alpha1
kind: Schema
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"inv.sdcio.dev/v1alpha1","kind":"Schema","metadata":{"annotations":{},"name":"pcc-1.40","namespace":"sdc-system"},"spec":{"provider":"pcc.ericsson.sdcio.dev","repositories":[{"credentials":"yang-schema-deploy-token","dirs":[{"dst":".","src":"pcc/1.40"}],"kind":"branch","ref":"non-existing-branch","repoURL":"https://code.swisscom.com/swisscom/mobile/...","schema":{"includes":["."],"models":["."]}}],"version":"1.40"}}
  creationTimestamp: "2026-05-21T11:57:28Z"
  finalizers:
  - schema.inv.sdcio.dev/finalizer
  generation: 1
  name: pcc-1.40
  namespace: sdc-system
  resourceVersion: "3102670791"
  uid: 2cb92974-b3fe-4cdc-afc5-c037ddd8a154
spec:
  provider: pcc.ericsson.sdcio.dev
  repositories:
  - credentials: yang-schema-deploy-token
    dirs:
    - dst: .
      src: pcc/1.40
    kind: branch
    ref: non-existing-branch
    repoURL: https://code.swisscom.com/swisscom/...
    schema:
      includes:
      - .
      models:
      - .
  version: "1.40"
status:
  conditions:
  - lastTransitionTime: "2026-05-21T11:57:29Z"
    message: 'cannot load schema err cannot perform fetch, err: authentication failed,
      err: couldn''t find remote ref "refs/heads/non-existing-branch"'
    reason: Failed
    status: "False"
    type: Ready

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions