Skip to content

Bug 1991662: Catalog switcher #144

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

Merged
merged 3 commits into from
Aug 9, 2021

Conversation

kevinrizza
Copy link
Member

  • Implement catalog switching proposal

The command + in sed is non-portable. The posix compliant version of
this command is {1,}

This change allows this script to run on a mac too (which uses BSD sed)

See https://riptutorial.com/sed/topic/9436/bsd-macos-sed-vs--gnu-sed-vs--the-posix-sed-specification

Note: GVK was implemented but disabled due to security concerns.
Future versions will address these concerns

Signed-off-by: John Hunkins [email protected]

  • Address review comments from ecordell
  • reorganize imports
  • change logging common case to debug

Signed-off-by: John Hunkins [email protected]

  • removed all watcher related code
  • this is the commit that should be reviewed later
    when it comes time to re-enable the GVK code

Signed-off-by: John Hunkins [email protected]

  • update vendor to remove dynamic lister code

Signed-off-by: John Hunkins [email protected]

  • fix incorrect names and improper error usage
  • fix names that don't match Golang convention
  • fix misspelled package name
  • return nil for sync function casting

Signed-off-by: John Hunkins [email protected]

  • change code block organization and add mutex

Signed-off-by: John Hunkins [email protected]

  • remove all traces of GVK template feature
  • clean up every instance of the GVK templating feature

  • add last minute change for RWMutex instead of Mutex

  • this is the second commit that should be reviewed later
    when it comes time to re-enable the GVK code

Signed-off-by: John Hunkins [email protected]

  • return status update errors and adjust logging

Signed-off-by: John Hunkins [email protected]

  • address review comments
  • update logging for clarity
  • clean up code blocks
  • refactor catalogsource helper functions:
    • remove mutex
    • remove two step get/update* in preference to update* even though
      this may result in more "the object has been modified" errors
    • rename helper functions to clarify usage
    • clarify the update helper function docs

Signed-off-by: John Hunkins [email protected]

Upstream-repository: operator-lifecycle-manager
Upstream-commit: 5f6fcd14f08a7e2a81b016fa83132ea68242f335

* Implement catalog switching proposal

- implements catalog switching proposal
See https://github.com/operator-framework/enhancements/blob/master/enhancements/automatic-catalog-switching-annotations.md
- picks up v0.10.3
- change sed command in copy_crds.sh to be posix compliant

The command + in sed is non-portable. The posix compliant version of
this command is {1,}

This change allows this script to run on a mac too (which uses BSD sed)

See https://riptutorial.com/sed/topic/9436/bsd-macos-sed-vs--gnu-sed-vs--the-posix-sed-specification

Note: GVK was implemented but disabled due to security concerns.
Future versions will address these concerns

Signed-off-by: John Hunkins <[email protected]>

* Address review comments from ecordell

- reorganize imports
- change logging common case to debug

Signed-off-by: John Hunkins <[email protected]>

* removed all watcher related code

- this is the commit that should be reviewed later
when it comes time to re-enable the GVK code

Signed-off-by: John Hunkins <[email protected]>

* update vendor to remove dynamic lister code

Signed-off-by: John Hunkins <[email protected]>

* fix incorrect names and improper error usage

- fix names that don't match Golang convention
- fix misspelled package name
- return nil for sync function casting

Signed-off-by: John Hunkins <[email protected]>

* change code block organization and add mutex

Signed-off-by: John Hunkins <[email protected]>

* remove all traces of GVK template feature

- clean up every instance of the GVK templating feature
- add last minute change for RWMutex instead of Mutex

- this is the second commit that should be reviewed later
when it comes time to re-enable the GVK code

Signed-off-by: John Hunkins <[email protected]>

* return status update errors and adjust logging

Signed-off-by: John Hunkins <[email protected]>

* address review comments

- update logging for clarity
- clean up code blocks
- refactor catalogsource helper functions:
  - remove mutex
  - remove two step get/update* in preference to update* even though
    this may result in more "the object has been modified" errors
  - rename helper functions to clarify usage
  - clarify the update helper function docs

Signed-off-by: John Hunkins <[email protected]>

Upstream-repository: operator-lifecycle-manager
Upstream-commit: 5f6fcd14f08a7e2a81b016fa83132ea68242f335
@openshift-ci openshift-ci bot requested review from anik120 and dinhxuanvu July 30, 2021 17:57
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 30, 2021
@timflannagan
Copy link
Contributor

/retest

@timflannagan
Copy link
Contributor

This lgtm to me but we're waiting for either exception approval or this to land as a bug in z-stream.

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2021
@timflannagan
Copy link
Contributor

/retest

@timflannagan
Copy link
Contributor

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2021
@davegord
Copy link

/retest

3 similar comments
@timflannagan
Copy link
Contributor

/retest

@davegord
Copy link

/retest

@davegord
Copy link

/retest

@kevinrizza
Copy link
Member Author

 Status: "Failure",
            Message: "Operation cannot be fulfilled on catalogsources.operators.coreos.com \"catalog-5dh25\": the object has been modified; please apply your changes to the latest version and try again",
            Reason: "Conflict",
            Details: {
                Name: "catalog-5dh25",
                Group: "operators.coreos.com",
                Kind: "catalogsources",
                UID: "",
                Causes: nil,
                RetryAfterSeconds: 0,
            },
            Code: 409,

Looks like we're not resilient to cache invalidation and need to add retry logic. I believe these failures are valid

/hold

so we don't keep wasting test resources

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 31, 2021
Upstream-repository: operator-lifecycle-manager
Upstream-commit: d55593954671505ef56bf09eb2e7900069fedecb
@kevinrizza
Copy link
Member Author

/hold cancel

tests updated, should avoid that flake now

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 2, 2021
In some cases, the discovery client can return a kube server version
with the minor version field as a non uint value. To properly parse the
value and get all version fields correctly, instead directly parse the
GitVersion string for all values of the kube server version

Upstream-repository: operator-lifecycle-manager
Upstream-commit: 31350db3ec552fbabbedda33929538983155dea9
@kevinrizza
Copy link
Member Author

/test e2e-gcp

@kevinrizza
Copy link
Member Author

/retest

@kevinrizza
Copy link
Member Author

/test e2e-gcp

@kevinrizza
Copy link
Member Author

/test e2e-upgrade

@davegord
Copy link

davegord commented Aug 4, 2021

/test e2e-gcp

@kevinrizza
Copy link
Member Author

/retest

1 similar comment
@kevinrizza
Copy link
Member Author

/retest

@kevinrizza
Copy link
Member Author

/test e2e-upgrade

2 similar comments
@kevinrizza
Copy link
Member Author

/test e2e-upgrade

@kevinrizza
Copy link
Member Author

/test e2e-upgrade

@kevinrizza
Copy link
Member Author

/test e2e-upgrade

}

// make the update if possible
if _, err := client.OperatorsV1alpha1().CatalogSources(catsrc.GetNamespace()).Update(context.TODO(), catsrc, metav1.UpdateOptions{}); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

There is a bug in this function as this Update call only updates the spec, not the status. Another call UpdateStatus is needed here.
This is the downstream PR so this needs to be fixed upstream first.

@kevinrizza
Copy link
Member Author

/test e2e-upgrade

3 similar comments
@kevinrizza
Copy link
Member Author

/test e2e-upgrade

@kevinrizza
Copy link
Member Author

/test e2e-upgrade

@kevinrizza
Copy link
Member Author

/test e2e-upgrade

@kevinrizza kevinrizza changed the title Catalog switcher (#2281) Bug 1991662: Catalog switcher (#2281) Aug 9, 2021
@kevinrizza kevinrizza changed the title Bug 1991662: Catalog switcher (#2281) Bug 1991662: Catalog switcher Aug 9, 2021
@kevinrizza
Copy link
Member Author

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 9, 2021

@kevinrizza: An error was encountered searching for bug 1991662 on the Bugzilla server at https://bugzilla.redhat.com. No known errors were detected, please see the full error message for details.

Full error message. could not unmarshal response body: invalid character '<' looking for beginning of value

Please contact an administrator to resolve this issue, then request a bug refresh with /bugzilla refresh.

In response to this:

Bug 1991662: Catalog switcher (#2281)

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 9, 2021

@kevinrizza: An error was encountered searching for bug 1991662 on the Bugzilla server at https://bugzilla.redhat.com. No known errors were detected, please see the full error message for details.

Full error message. could not unmarshal response body: invalid character '<' looking for beginning of value

Please contact an administrator to resolve this issue, then request a bug refresh with /bugzilla refresh.

In response to this:

/bugzilla refresh

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.

Copy link
Member

@dinhxuanvu dinhxuanvu 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 Aug 9, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 9, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, kevinrizza

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [dinhxuanvu,kevinrizza]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@davegord
Copy link

davegord commented Aug 9, 2021

/retest

1 similar comment
@davegord
Copy link

davegord commented Aug 9, 2021

/retest

@openshift-ci openshift-ci bot merged commit fb92eba into openshift:master Aug 9, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 9, 2021

@kevinrizza: An error was encountered searching for external tracker bugs for bug 1991662 on the Bugzilla server at https://bugzilla.redhat.com. No known errors were detected, please see the full error message for details.

Full error message. could not unmarshal response body: invalid character '<' looking for beginning of value

Please contact an administrator to resolve this issue, then request a bug refresh with /bugzilla refresh.

In response to this:

Bug 1991662: Catalog switcher

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.

ankitathomas pushed a commit to ankitathomas/operator-framework-olm that referenced this pull request Sep 8, 2021
OLM is unable to properly handle the case where a bundle author
explicitly adds a hardcoded reference to a service account with a name
that matches the name of the service account defined by the deployment
spec in the CSV. This commit adds a validation method to ensure that the
name of the service account in a bundle does not match
deployment.Spec.Template.Spec.ServiceAccountName in the csv's spec

Upstream-repository: api
Upstream-commit: 0fe04f80e0102dc6973109a221a7babd6bee005e
ankitathomas pushed a commit to ankitathomas/operator-framework-olm that referenced this pull request Sep 9, 2021
OLM is unable to properly handle the case where a bundle author
explicitly adds a hardcoded reference to a service account with a name
that matches the name of the service account defined by the deployment
spec in the CSV. This commit adds a validation method to ensure that the
name of the service account in a bundle does not match
deployment.Spec.Template.Spec.ServiceAccountName in the csv's spec

Upstream-repository: api
Upstream-commit: 0fe04f80e0102dc6973109a221a7babd6bee005e
timflannagan pushed a commit to timflannagan/operator-framework-olm that referenced this pull request Nov 30, 2021
OLM is unable to properly handle the case where a bundle author
explicitly adds a hardcoded reference to a service account with a name
that matches the name of the service account defined by the deployment
spec in the CSV. This commit adds a validation method to ensure that the
name of the service account in a bundle does not match
deployment.Spec.Template.Spec.ServiceAccountName in the csv's spec

Upstream-repository: api
Upstream-commit: 0fe04f80e0102dc6973109a221a7babd6bee005e
timflannagan pushed a commit to timflannagan/operator-framework-olm that referenced this pull request Nov 30, 2021
OLM is unable to properly handle the case where a bundle author
explicitly adds a hardcoded reference to a service account with a name
that matches the name of the service account defined by the deployment
spec in the CSV. This commit adds a validation method to ensure that the
name of the service account in a bundle does not match
deployment.Spec.Template.Spec.ServiceAccountName in the csv's spec

Upstream-repository: api
Upstream-commit: 0fe04f80e0102dc6973109a221a7babd6bee005e
perdasilva pushed a commit to perdasilva/operator-framework-olm that referenced this pull request Mar 4, 2022
OLM is unable to properly handle the case where a bundle author
explicitly adds a hardcoded reference to a service account with a name
that matches the name of the service account defined by the deployment
spec in the CSV. This commit adds a validation method to ensure that the
name of the service account in a bundle does not match
deployment.Spec.Template.Spec.ServiceAccountName in the csv's spec

Upstream-repository: api
Upstream-commit: 0fe04f80e0102dc6973109a221a7babd6bee005e
perdasilva pushed a commit to perdasilva/operator-framework-olm that referenced this pull request Mar 4, 2022
OLM is unable to properly handle the case where a bundle author
explicitly adds a hardcoded reference to a service account with a name
that matches the name of the service account defined by the deployment
spec in the CSV. This commit adds a validation method to ensure that the
name of the service account in a bundle does not match
deployment.Spec.Template.Spec.ServiceAccountName in the csv's spec

Upstream-repository: api
Upstream-commit: 0fe04f80e0102dc6973109a221a7babd6bee005e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants