openshift / oc-mirror

Lifecycle manager for internet-disconnected OpenShift environments
Apache License 2.0
82 stars 80 forks source link

Mirroring fails when minVersion or maxVersion removed from config. #805

Open kristvanbesien opened 4 months ago

kristvanbesien commented 4 months ago

Version

$ oc-mirror version
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.15.0-202402082307.p0.gcae37aa.assembly.stream.el8-cae37aa", GitCommit:"cae37aa25d9d96bdedcee45e659188a644f78a58", GitTreeState:"clean", BuildDate:"2024-02-09T00:49:20Z", GoVersion:"go1.20.12 X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

What happened?

I created a mirror using this config:

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  registry:
    imageURL: registry.s.kri.st/mirror/oc-mirror-metadata
    skipTLS: false
mirror:
  platform:
    channels:
    - name: stable-4.14
      type: ocp
    - name: fast-4.14
      type: ocp
    - name: candidate-4.14
      type: ocp
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
    packages:
    - name: odf-operator
    - name: advanced-cluster-management
      channels:
      - name: release-2.9
      - name: release-2.8
        minVersion: 'a2.8.4'
        maxVersion: '2.8.4'
    - name: kubevirt-hyperconverged
    - name: lvms-operator
    - name: kubernetes-nmstate-operator
    - name: sriov-network-operator

That mirror ran successfully.

I then edited the config and removed the minVersion and maxVersion

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  registry:
    imageURL: registry.s.kri.st/mirror/oc-mirror-metadata
    skipTLS: false
mirror:
  platform:
    channels:
    - name: stable-4.14
      type: ocp
    - name: fast-4.14
      type: ocp
    - name: candidate-4.14
      type: ocp
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
    packages:
    - name: odf-operator
    - name: advanced-cluster-management
      channels:
      - name: release-2.9
      - name: release-2.8
    - name: kubevirt-hyperconverged
    - name: lvms-operator
    - name: kubernetes-nmstate-operator
    - name: sriov-network-operator

Then I ran mirror again, and got an errror:

Checking push permissions for registry.s.kri.st
Found: oc-mirror-workspace/src/publish
Found: oc-mirror-workspace/src/v2
Found: oc-mirror-workspace/src/charts
Found: oc-mirror-workspace/src/release-signatures

The rendered catalog is invalid.

Run "oc-mirror list operators --catalog CATALOG-NAME --package PACKAGE-NAME" for more information.

error: error updating include config: Invalid character(s) found in major number "advanced-cluster-management"

What did you expect to happen?

I expected the mirror run successfulluy.

Note that this is something I also seen on a different system. So I set out to try to reproduce it in my own home system, and I have the problem there as well.

kristvanbesien commented 4 months ago

What also fails is:

openshift-bot commented 1 month ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 6 days ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale