Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OLM 0.16.1 fails to handle package semver dependencies. #1770

Closed
cdjohnson opened this issue Sep 18, 2020 · 3 comments
Closed

OLM 0.16.1 fails to handle package semver dependencies. #1770

cdjohnson opened this issue Sep 18, 2020 · 3 comments
Labels
triage/unresolved Indicates an issue that can not or will not be resolved.

Comments

@cdjohnson
Copy link

Bug Report

The operator-registry project added the ability to model semver dependencies via the operator bundle dependencies.yaml, yet the latest version of OLM (0.16.1) does not appear to be able to consume these dependencies.

What did you do?

  1. Installed OCP 4.6 nightly build 9/17/2020 which has OLM 0.16.1.
  2. Created a catalog index image with the following operator bundle taxonomy
Package Version Channel replaces olm.skipRange olm.package
testoperatora 1.0.0 v1.0 none none none
testoperatorb 4.0.0 v4.0 none none testoperatora: <1.3

The dependency.yaml for b 4.0.0 is:

dependencies:
  - type: olm.package
    packageName: testoperatora
    version: "<1.3"
  1. Created the catalog source
cat <<EOF | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: depcatalogs
  namespace: openshift-marketplace
spec:
  displayName: "depcatalogs-semver-dep-nowork Operators"
  image: docker.io/cdjohnson/depcatalogs@sha256:40474c14d6aef2c0ca0fa5a12ee0d774430b3cec7afab9638ce6ac03aa2671ca
  publisher: IBM
  sourceType: grpc
EOF
  1. Create namespace deptest
  2. Create a own-namespace operator group
cat <<EOF | oc apply -f -
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: operatorgroup
spec:
  targetNamespaces:
  - deptest
EOF
  1. Create a subscription for operator b that has a dependency on A via the dependency.yaml
cat <<EOF | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: testoperatorb
spec:
  source: depcatalogs
  sourceNamespace: openshift-marketplace

  channel: v4.0
  installPlanApproval: Automatic
  name: testoperatorb
  startingCSV: testoperatorb.v4.0.0
EOF

What did you expect to see?
I expected both operators A and B to be installed.

What did you see instead? Under which circumstances?
Operator B was installed, but not A.

Environment

  • operator-lifecycle-manager version:

0.16.1

  • Kubernetes version information:
    Client Version: 4.6.0-0.nightly-2020-09-15-112431
    Server Version: 4.6.0-0.nightly-2020-09-17-073141
    Kubernetes Version: v1.19.0+b4ffb45

  • Kubernetes cluster kind:
    OCP on aws

Possible Solution
None

Additional context
Add any other context about the problem here.

@cdjohnson
Copy link
Author

cdjohnson commented Sep 19, 2020

I found I had a few user errors.

  1. The file was named incorrectly. I had dependency.yaml, but the real name is dependencies.yaml
    • The opm registry add tool did log this in the debug messages as not detected, but I missed that.
  2. The format of the dependencies.yaml for type: olm.package is incorrect in the OCP documentation

Instead of:

dependencies:
  - type: olm.package
    packageName: testoperatora
    version: "<1.3"

it should be:

dependencies:
  - type: olm.package
    value: 
      packageName: testoperatora
      version: "<1.3"

There is no error detected in OPM nor OLM with this invalid format.

  1. I was using the wrong range syntax. The blang implementation requires all three parts, unlike the masterminds version, which I'm more used-to. The catalog-operator debug logs showed this, but not the opm client.

So, the final, working version:

dependencies.yaml
dependencies:
  - type: olm.package
    value: 
      packageName: testoperatora
      version: "<1.3.0"

Summary:

  1. Documentation error in the OCP documentation (schema error) (bugzilla)
  2. Lack of error handling in OLM (misnamed file, schema error)
  3. Lack of error handling in OPM (misnamed file, schema error, semver range format) (issue)

@stale
Copy link

stale bot commented Nov 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 18, 2020
@openshift-ci-robot openshift-ci-robot added triage/unresolved Indicates an issue that can not or will not be resolved. and removed wontfix labels Nov 19, 2020
@stale
Copy link

stale bot commented Jan 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 18, 2021
@stale stale bot closed this as completed Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/unresolved Indicates an issue that can not or will not be resolved.
Projects
None yet
Development

No branches or pull requests

2 participants