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

csvJson is not found via grpc for sosivio operator #993

Open
mvalarh opened this issue Jul 14, 2022 · 3 comments
Open

csvJson is not found via grpc for sosivio operator #993

mvalarh opened this issue Jul 14, 2022 · 3 comments

Comments

@mvalarh
Copy link

mvalarh commented Jul 14, 2022

We are using latest opm version

$ opm version
Version: version.Version{OpmVersion:"v1.23.2", GitCommit:"82505333", BuildDate:"2022-07-04T13:45:39Z", GoOs:"linux", GoArch:"amd64"}

Trying to add bundles from sosivio operator to index

$ opm index add -b quay.io/operatorhubio/sosivio:v1.2.0,quay.io/operatorhubio/sosivio:v1.2.1,quay.io/operatorhubio/sosivio:v1.3.0,quay.io/operatorhubio/sosivio:v1.3.1,quay.io/operatorhubio/sosivio:v1.4.1,quay.io/operatorhubio/sosivio:v1.4.1-1 -t localhost/index  --mode semver

Then starting index

$ podman run -p 50051:50051 localhost/index

When I query bundle and its cvsJson via grpc I get following

$ grpcurl -plaintext -d '{ "pkgName": "sosivio", "csvName" : "sosivio-operator.v1.4.1-78", "channelName": "stable" }' localhost:50051 api.Registry.GetBundle | jq .csvJson
"{\"apiVersion\":\"operators.coreos.com/v1alpha1\",\"kind

and it is not found for

$ grpcurl -plaintext -d '{ "pkgName": "sosivio", "csvName" : "sosivio-operator.v1.4.1.1-80", "channelName": "stable" }' localhost:50051 api.Registry.GetBundle | jq .csvJson
null
@joelanford
Copy link
Member

It looks like your index add command adds in semver mode:

  • 1.2.0
  • 1.2.1
  • 1.3.0
  • 1.3.1
  • 1.4.1
  • 1.4.1-1

Semver mode builds channels based on the semver ordering of csv.spec.version. Looking at those CSVs in the repo, I see:

$ find operators/sosivio -name '*cluster*' -exec yq '.spec.version' {} \;
1.3.0
1.3.1
1.4.1-1
1.4.1
1.2.0
1.2.1

If you sort those according to semver rules, you'll get:

1.2.0
1.2.1
1.3.0
1.3.1
1.4.1-1
1.4.1

So the channel head is the CSV with version 1.4.1, which appears to be sosivio-operator.v1.4.1-79

I think opm is working as expected here, but let me know if there's a detail I'm missing.

@mvalarh
Copy link
Author

mvalarh commented Jul 14, 2022

Does that mean that in semver mode one would csvJson only for head channel?

@joelanford
Copy link
Member

joelanford commented Jul 14, 2022

IIRC its the GRPC server that implements "csvJson is served only for channel heads" . So that's true regardless of the add mode.

That was wrong -- opm removes the csvJson from the database for all non-channel-heads. But I think that's true for the replaces, semver and semver-skippatch modes.

So yeah, semver only keeps CSVs of channel heads in the DB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants