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

Modify channels for previous versions of manifests #5062

Conversation

varshaprasad96
Copy link
Member

@varshaprasad96 varshaprasad96 commented Jul 14, 2021

Previously, the versions of manifests other than the latest version,
used to have the channel as candidate. This caused errors
while running the bundle. With this commit, the channels for those
manifests would be the defaultchannel specified in package.yaml.

Signed-off-by: varshaprasad96 [email protected]

Motivation for the change:
Previous versions of pkgman bundles used to error.

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@varshaprasad96 varshaprasad96 requested a review from estroz July 14, 2021 23:19
@varshaprasad96 varshaprasad96 changed the title modify default channels for previous versions of manifests Modify channels for previous versions of manifests Jul 14, 2021
@varshaprasad96
Copy link
Member Author

@emmajiafan this would solve https://bugzilla.redhat.com/show_bug.cgi?id=1979506&GoAheadAndLogIn=1. Tested with the following:

Built bundles from pkgmanifests:

➜  test-pkgmanifest git:(main) ✗ /Users/vnarsing/go/bin/operator-sdk pkgman-to-bundle ditto-operator  --image-tag-base quay.io/vnarsing/ditto-operator --build-cmd "docker build -f bundle.Dockerfile . -t"
INFO[0000] Packagemanifests will be migrated to bundles in bundles directory
INFO[0000] Supported channels cannot be identified from CSV ditto-operator.v0.1.0, using default channel alpha
INFO[0000] Creating bundles/bundle-0.1.0/bundle.Dockerfile
INFO[0000] Creating bundles/bundle-0.1.0/bundle/metadata/annotations.yaml
INFO[0000] Bundle metadata generated suceessfully
INFO[0000] Using the specified command to build image
INFO[0001] Successfully built image quay.io/vnarsing/ditto-operator:0.1.0
INFO[0001] Supported channels cannot be identified from CSV ditto-operator.v0.1.1, using default channel alpha
INFO[0001] Creating bundles/bundle-0.1.1/bundle.Dockerfile
INFO[0001] Creating bundles/bundle-0.1.1/bundle/metadata/annotations.yaml
INFO[0001] Bundle metadata generated suceessfully
INFO[0001] Using the specified command to build image
INFO[0002] Successfully built image quay.io/vnarsing/ditto-operator:0.1.1
INFO[0002] Creating bundles/bundle-0.2.0/bundle.Dockerfile
INFO[0002] Creating bundles/bundle-0.2.0/bundle/metadata/annotations.yaml
INFO[0002] Bundle metadata generated suceessfully
INFO[0002] Using the specified command to build image
INFO[0003] Successfully built image quay.io/vnarsing/ditto-operator:0.2.0

Used run-bundle with older versions:

➜  bundles git:(main) ✗ operator-sdk run bundle quay.io/vnarsing/ditto-operator:0.1.0 --timeout=6m
INFO[0037] Successfully created registry pod: quay-io-vnarsing-ditto-operator-0-1-0
INFO[0037] Created CatalogSource: ditto-operator-catalog
INFO[0037] OperatorGroup "operator-sdk-og" created
INFO[0037] Created Subscription: ditto-operator-v0-1-0-sub
INFO[0043] Approved InstallPlan install-lllsb for the Subscription: ditto-operator-v0-1-0-sub
INFO[0043] Waiting for ClusterServiceVersion "default/ditto-operator.v0.1.0" to reach 'Succeeded' phase
INFO[0043]   Waiting for ClusterServiceVersion "default/ditto-operator.v0.1.0" to appear
INFO[0055]   Found ClusterServiceVersion "default/ditto-operator.v0.1.0" phase: Pending
INFO[0057]   Found ClusterServiceVersion "default/ditto-operator.v0.1.0" phase: Installing
INFO[0095]   Found ClusterServiceVersion "default/ditto-operator.v0.1.0" phase: Succeeded
INFO[0095] OLM has successfully installed "ditto-operator.v0.1.0"

@estroz
Copy link
Member

estroz commented Jul 15, 2021

This needs to be cherry-picked to 1.8.x and 1.9.x

Previously, the versions of manifests other than the latest version,
used to have the channel as `candidate`. This caused errors
while running the bundle. With this commit, the channels for those
manifests would be the defaultchannel specified in package.yaml.

Signed-off-by: varshaprasad96 <[email protected]>
@varshaprasad96 varshaprasad96 force-pushed the fix/pkgmanToBundle-channels branch from 9eba542 to 7d49ed0 Compare July 15, 2021 20:37
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2021
@varshaprasad96
Copy link
Member Author

closing and reopening for ci

@estroz
Copy link
Member

estroz commented Jul 16, 2021

I’d just merge this, netlify seems to be erroneously failing.

@varshaprasad96 varshaprasad96 merged commit d7b4ad1 into operator-framework:master Jul 16, 2021
@varshaprasad96
Copy link
Member Author

/cherry-pick v1.9.x

@openshift-cherrypick-robot

@varshaprasad96: new pull request created: #5067

In response to this:

/cherry-pick v1.9.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@varshaprasad96
Copy link
Member Author

/cherry-pick v1.8.x

@openshift-cherrypick-robot

@varshaprasad96: #5062 failed to apply on top of branch "v1.8.x":

Applying: modify default channels for previous versions of manifests
.git/rebase-apply/patch:19: trailing whitespace.
      not specified in `package.yaml` to `defaultChannel` instead of "candidate". 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	internal/cmd/operator-sdk/pkgmantobundle/cmd.go
M	internal/cmd/operator-sdk/pkgmantobundle/pkgmantobundle_test.go
Falling back to patching base and 3-way merge...
Auto-merging internal/cmd/operator-sdk/pkgmantobundle/pkgmantobundle_test.go
CONFLICT (content): Merge conflict in internal/cmd/operator-sdk/pkgmantobundle/pkgmantobundle_test.go
Auto-merging internal/cmd/operator-sdk/pkgmantobundle/cmd.go
CONFLICT (content): Merge conflict in internal/cmd/operator-sdk/pkgmantobundle/cmd.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 modify default channels for previous versions of manifests
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick v1.8.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants