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

Registry operator should be in sync with operator SDK releases #1106

Closed
3 tasks done
Tracked by #410
kim-tsao opened this issue Apr 14, 2023 · 27 comments · Fixed by devfile/registry-operator#45
Closed
3 tasks done
Tracked by #410
Assignees
Labels
area/registry Devfile registry for stacks and infrastructure kind/user-story User story for new enhancement severity/blocker Issues that prevent developers from working

Comments

@kim-tsao
Copy link
Contributor

kim-tsao commented Apr 14, 2023

/kind user-story

Which area this user story is related to?

/area registry

User Story

As a registry operator provider, I want to ensure the operator sdk is kept up to date and in sync with supported k8s and go versions so there is no breakage when running makefile commands.

Acceptance Criteria

  • When updating k8s and go versions, we need to monitor compatibility with the operator SDK version: https://sdk.operatorframework.io/docs/upgrading-sdk-version/ and perform any migration if necessary
  • We need to ensure these changes are tested on Openshift and Kubernetes
  • Ensure README and Release notes are documented with this changes

Target Date: 08-31-2023

@openshift-ci openshift-ci bot added the kind/user-story User story for new enhancement label Apr 14, 2023
@kim-tsao
Copy link
Contributor Author

related to epic: #1007

@michael-valdron
Copy link
Member

Matching status of #1007

@michael-valdron
Copy link
Member

related to epic: #1007

Now related to: #410

@michael-valdron
Copy link
Member

Is there anything further information needed for this issue to be ready for a sprint?

cc: @kim-tsao

@michael-valdron
Copy link
Member

/area registry

@openshift-ci openshift-ci bot added the area/registry Devfile registry for stacks and infrastructure label Jul 18, 2023
@michael-valdron michael-valdron self-assigned this Jul 18, 2023
@michael-valdron
Copy link
Member

Need to start next sprint due to giving focus towards completion of other tasks.

@michael-valdron
Copy link
Member

Adding all changes needed for go/v3 to go from previous version of the operator sdk v1.22 to the current version v1.26:

@michael-valdron
Copy link
Member

Migrating from Ginkgo v1 to Ginkgo v2: https://onsi.github.io/ginkgo/MIGRATING_TO_V2

@michael-valdron
Copy link
Member

Troubleshooting problem:

E0731 23:31:10.200109       1 leaderelection.go:330] error retrieving resource lock registry-operator-system/1984829e.devfile.io: leases.coordination.k8s.io "1984829e.devfile.io" is forbidden: User "system:serviceaccount:registry-operator-system:registry-operator-default" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "registry-operator-system"
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        default {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "allowed": true}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        validate create {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "allowed": true}

@michael-valdron
Copy link
Member

Adding all changes needed for go/v3 to go from previous version of the operator sdk v1.22 to the current version v1.26

Current version of the operator sdk actually should be v1.28: https://github.com/devfile/registry-operator/blob/dea070ae240936e290c59e7a1490d836137cbc7d/README.md?plain=1#L30

Adding all go/v3 changes needed for v1.26 to v1.28:

@michael-valdron
Copy link
Member

Troubleshooting problem:

E0731 23:31:10.200109       1 leaderelection.go:330] error retrieving resource lock registry-operator-system/1984829e.devfile.io: leases.coordination.k8s.io "1984829e.devfile.io" is forbidden: User "system:serviceaccount:registry-operator-system:registry-operator-default" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "registry-operator-system"
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        default {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "allowed": true}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        validate create {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "allowed": true}

This was a result of the namePrefix not applying correctly to reference fields. Need to investigate further to decide on a solution going forward, for now the short term fix seems to be assuming this prefix will not be applied to references and manually setting the prefix in with the base name seems to work.

@michael-valdron michael-valdron added the severity/blocker Issues that prevent developers from working label Aug 3, 2023
@michael-valdron
Copy link
Member

Continuing in Sprint 245 due to vacation leave.

@thepetk
Copy link
Contributor

thepetk commented Aug 9, 2023

Moving item to 245 as requested

@michael-valdron
Copy link
Member

Troubleshooting problem:

E0731 23:31:10.200109       1 leaderelection.go:330] error retrieving resource lock registry-operator-system/1984829e.devfile.io: leases.coordination.k8s.io "1984829e.devfile.io" is forbidden: User "system:serviceaccount:registry-operator-system:registry-operator-default" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "registry-operator-system"
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        default {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "allowed": true}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        validate create {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "allowed": true}

This was a result of the namePrefix not applying correctly to reference fields. Need to investigate further to decide on a solution going forward, for now the short term fix seems to be assuming this prefix will not be applied to references and manually setting the prefix in with the base name seems to work.

Continuing to use full account and namespace names under role bindings.

@michael-valdron
Copy link
Member

michael-valdron commented Aug 27, 2023

Troubleshooting problem:

E0731 23:31:10.200109       1 leaderelection.go:330] error retrieving resource lock registry-operator-system/1984829e.devfile.io: leases.coordination.k8s.io "1984829e.devfile.io" is forbidden: User "system:serviceaccount:registry-operator-system:registry-operator-default" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "registry-operator-system"
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        default {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/mutate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "cf3aafb5-a4b7-4e10-996b-9cfac32ca8d8", "allowed": true}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     received request        {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "kind": "registry.devfile.io/v1alpha1, Kind=DevfileRegistry", "resource": {"group":"registry.devfile.io","version":"v1alpha1","resource":"devfileregistries"}}
2023-07-31T23:31:11Z    INFO    devfileregistry-resource        validate create {"name": "devfile-registry"}
2023-07-31T23:31:11Z    DEBUG   controller-runtime.webhook.webhooks     wrote response  {"webhook": "/validate-registry-devfile-io-v1alpha1-devfileregistry", "code": 200, "reason": "", "UID": "e6a73772-32d8-48f7-8515-d4515ea39b3e", "allowed": true}

This was a result of the namePrefix not applying correctly to reference fields. Need to investigate further to decide on a solution going forward, for now the short term fix seems to be assuming this prefix will not be applied to references and manually setting the prefix in with the base name seems to work.

Continuing to use full account and namespace names under role bindings.

Resolved these errors by using a different service account name for the operator, previously using the default service account: devfile/registry-operator@5791f81

@michael-valdron
Copy link
Member

Multi arch build and push rule docker-buildx fixed up, this rule only supports docker: devfile/registry-operator@f73ea53

@michael-valdron
Copy link
Member

michael-valdron commented Aug 28, 2023

Created CHANGLOG.md to document changes for upcoming releases. Initial changes includes this issue and #881: devfile/registry-operator@6782eab

Issue is ready for review: devfile/registry-operator#45

@michael-valdron
Copy link
Member

Need to merge openshift/release#42759 before proceeding.

@michael-valdron
Copy link
Member

Need to merge openshift/release#42759 before proceeding.

openshift/release#42759 has been merged, unblocked.

@michael-valdron
Copy link
Member

Set back with unexpected integration test errors on the OpenShift CI: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/devfile_registry-operator/45/pull-ci-devfile-registry-operator-main-v4.12-registry-operator-integration-test/1696556383018684416

This was resolved setting GOFLAGS="" on all go install commands.

@michael-valdron
Copy link
Member

Testing is failing possibly due to missed Ginkgo V2 changes for creating a timeout to allow the test devfile registries to deploy.

@michael-valdron
Copy link
Member

michael-valdron commented Aug 30, 2023

Testing is failing possibly due to missed Ginkgo V2 changes for creating a timeout to allow the test devfile registries to deploy.

This does not seem to be the case, the integration tests seem to fail if the operator is deployed during make test-integration rather than separately by running make install && make deploy beforehand.

Pod registry-operator-controller-manager-75f6b6dcf8-9cpwt created in namespace registry-operator-system...Checking startup data.
Pod started after 25.703438619 seconds
Devfile Registry pod to be ready
I0830 12:31:53.758728  240169 request.go:690] Waited for 1.047570809s due to client-side throttling, not priority and fairness, request: GET:https://api.crc.testing:6443/apis/authorization.openshift.io/v1?timeout=32s
exit status 1
exit status 1
------------------------------
• [FAILED] [2.105 seconds]
[Create Devfile Registry resource with headless enabled] [It] Should deploy a headless devfile registry on to the cluster
/home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:120

  [FAILED] Failed to create devfileregistry instance: exit status 1
  In [It] at: /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:127 @ 08/30/23 12:31:57.032
------------------------------
SSS

Summarizing 1 Failure:
  [FAIL] [Create Devfile Registry resource with headless enabled] [It] Should deploy a headless devfile registry on to the cluster
  /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:127

Ran 1 of 4 Specs in 43.097 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 3 Skipped

@feloy
Copy link
Contributor

feloy commented Aug 30, 2023

Testing is failing possibly due to missed Ginkgo V2 changes for creating a timeout to allow the test devfile registries to deploy.

This does not seem to be the case, the integration tests seem to fail if the operator is deployed during make test-integration rather than separately by running make install && make deploy beforehand.

Pod registry-operator-controller-manager-75f6b6dcf8-9cpwt created in namespace registry-operator-system...Checking startup data.
Pod started after 25.703438619 seconds
Devfile Registry pod to be ready
I0830 12:31:53.758728  240169 request.go:690] Waited for 1.047570809s due to client-side throttling, not priority and fairness, request: GET:https://api.crc.testing:6443/apis/authorization.openshift.io/v1?timeout=32s
exit status 1
exit status 1
------------------------------
• [FAILED] [2.105 seconds]
[Create Devfile Registry resource with headless enabled] [It] Should deploy a headless devfile registry on to the cluster
/home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:120

  [FAILED] Failed to create devfileregistry instance: exit status 1
  In [It] at: /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:127 @ 08/30/23 12:31:57.032
------------------------------
SSS

Summarizing 1 Failure:
  [FAIL] [Create Devfile Registry resource with headless enabled] [It] Should deploy a headless devfile registry on to the cluster
  /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:127

Ran 1 of 4 Specs in 43.097 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 3 Skipped

I probably encountered the same problem when testing the operator, working on #46. I have seen that if the operator is not deployed before running make test-integration, the operator is started at the beginning of the tests, but the Pod does not have the time to completely start, and the tests fail due to this.

@michael-valdron
Copy link
Member

Testing is failing possibly due to missed Ginkgo V2 changes for creating a timeout to allow the test devfile registries to deploy.

This does not seem to be the case, the integration tests seem to fail if the operator is deployed during make test-integration rather than separately by running make install && make deploy beforehand.

Pod registry-operator-controller-manager-75f6b6dcf8-9cpwt created in namespace registry-operator-system...Checking startup data.
Pod started after 25.703438619 seconds
Devfile Registry pod to be ready
I0830 12:31:53.758728  240169 request.go:690] Waited for 1.047570809s due to client-side throttling, not priority and fairness, request: GET:https://api.crc.testing:6443/apis/authorization.openshift.io/v1?timeout=32s
exit status 1
exit status 1
------------------------------
• [FAILED] [2.105 seconds]
[Create Devfile Registry resource with headless enabled] [It] Should deploy a headless devfile registry on to the cluster
/home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:120

  [FAILED] Failed to create devfileregistry instance: exit status 1
  In [It] at: /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:127 @ 08/30/23 12:31:57.032
------------------------------
SSS

Summarizing 1 Failure:
  [FAIL] [Create Devfile Registry resource with headless enabled] [It] Should deploy a headless devfile registry on to the cluster
  /home/mvaldron/source/repos/michael-valdron/devfile-registry-operator/tests/integration/pkg/tests/devfileregistry_tests.go:127

Ran 1 of 4 Specs in 43.097 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 3 Skipped

I probably encountered the same problem when testing the operator, working on #46. I have seen that if the operator is not deployed before running make test-integration, the operator is started at the beginning of the tests, but the Pod does not have the time to completely start, and the tests fail due to this.

I suspect the same thing, it looks like in the integration test suite we are checking if the pod is running but not if the pod is ready: https://github.com/devfile/registry-operator/blob/9ac99619807eccb75f0cdfff01c189d71c5bd921/tests/integration/pkg/client/pod.go#L66

For this issue I'm trying a short term fix https://github.com/michael-valdron/devfile-registry-operator/blob/2f45c9e2ec83f7444d13203e8d1f068aee12e184/.ci/openshift_integration.sh#L32, but moving forward we should be checking readiness as well. I'll open an issue for this after I have resolved the current issue.

@michael-valdron
Copy link
Member

openshift-ci is currently failing during setup of the environment: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/devfile_registry-operator/45/pull-ci-devfile-registry-operator-main-v4.12-registry-operator-integration-test/1696984101262725120

This has pushed the target date for completing this item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Devfile registry for stacks and infrastructure kind/user-story User story for new enhancement severity/blocker Issues that prevent developers from working
Projects
Status: Done ✅
Development

Successfully merging a pull request may close this issue.

5 participants