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

🌱 Update containers/image to v5.34.1 #1827

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Mar 3, 2025

However, due to some incompatibility between controller-gen and
github.com/proglottis/[email protected], we need to move the kubebuilder
comments so controller-gen doesn't try to access gpgme.

This meant moving the kubebuilder:rbac comments into their own
package, and focusing the webhook generation the just one directory.

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@tmshort tmshort requested a review from a team as a code owner March 3, 2025 16:28
Copy link

netlify bot commented Mar 3, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 22199fb
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/67c96821a4ff190008d562b2
😎 Deploy Preview https://deploy-preview-1827--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@tmshort tmshort force-pushed the update-containters branch 7 times, most recently from 3fe8072 to 1d6d327 Compare March 3, 2025 17:09
Makefile Outdated
@@ -133,14 +133,15 @@ manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole,
mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clustercatalogs.yaml $(KUSTOMIZE_CATD_CRDS_DIR)
rmdir $(CRD_WORKING_DIR)
# Generate the remaining operator-controller manifests
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/operator-controller/controllers/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
Copy link
Contributor

Choose a reason for hiding this comment

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

The problematic dep is called in the controller :-(
I thought in extra in a utils and then do something like that
it might works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That might just be my crazy idea I mentioned earlier

@tmshort tmshort force-pushed the update-containters branch from f485f89 to 872ec2f Compare March 3, 2025 19:06
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.52%. Comparing base (fed0ad5) to head (22199fb).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1827      +/-   ##
==========================================
+ Coverage   68.39%   68.52%   +0.12%     
==========================================
  Files          63       65       +2     
  Lines        5136     5138       +2     
==========================================
+ Hits         3513     3521       +8     
+ Misses       1392     1388       -4     
+ Partials      231      229       -2     
Flag Coverage Δ
e2e 51.69% <100.00%> (+0.16%) ⬆️
unit 56.03% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tmshort tmshort force-pushed the update-containters branch from 872ec2f to 8dcfbc2 Compare March 3, 2025 19:17
@tmshort
Copy link
Contributor Author

tmshort commented Mar 3, 2025

Replacement for #1692

@joelanford
Copy link
Member

I think we need to be going to the controller-tools repo to get this fixed there.

@tmshort
Copy link
Contributor Author

tmshort commented Mar 3, 2025

I think we need to be going to the controller-tools repo to get this fixed there.

Problem is that it doesn't seem to be controller-tools, specifically. It works fine locally, this seems to be a problem with gpgme somehow.

@perdasilva
Copy link
Contributor

perdasilva commented Mar 4, 2025

I think we need to be going to the controller-tools repo to get this fixed there.

Problem is that it doesn't seem to be controller-tools, specifically. It works fine locally, this seems to be a problem with gpgme somehow.

Could it be working locally because CGO_ENABLED=1?

The issue is the build tags don't get passed down to controller-gen when its loading the packages (somewhere around here). I've done local test hard-coding the containers_image_openpgp tag here and it seemed to work.

We need a way to configure controller-gen to pass build tags to the loader =S

@tmshort
Copy link
Contributor Author

tmshort commented Mar 4, 2025

@perdasilva
At first it was failing for me. After I did a go clean -modcache, it started working. Doing that in CI doesn't seem to work, and it also seems fragile.

To be blunt, this PR does work, because it avoids pulling in gpgme code by isolating the RBAC directives. Admittedly, fixing controler-gen would be great, but how long would that take and when would that happen?

@tmshort tmshort force-pushed the update-containters branch from 8dcfbc2 to 4569ead Compare March 4, 2025 14:26
@@ -13,8 +13,6 @@ import (

// +kubebuilder:webhook:admissionReviewVersions={v1},failurePolicy=Fail,groups=olm.operatorframework.io,mutating=true,name=inject-metadata-name.olm.operatorframework.io,path=/mutate-olm-operatorframework-io-v1-clustercatalog,resources=clustercatalogs,verbs=create;update,versions=v1,sideEffects=None,timeoutSeconds=10

// +kubebuilder:rbac:groups=olm.operatorframework.io,resources=clustercatalogs,verbs=get;list;watch;patch;update
Copy link
Contributor

Choose a reason for hiding this comment

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

That is interesting, we fail to get the RBAC but not to generate the webhook config based on the markers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

controller-gen also has a limitation that it cannot use multiple directories (as discovered in my earlier merging of the API directories).

So, I pulled all the RBAC into one place.
The webhook generation still looks at this one directory.

@tmshort tmshort force-pushed the update-containters branch from 4569ead to 91c16b3 Compare March 4, 2025 20:09
However, due to some incompatibility between controller-gen and
github.com/proglottis/[email protected], we need to move the kubebuilder
comments so controller-gen doesn't try to access gpgme.

This meant moving the kubebuilder:rbac comments into their own
package, and focusing the webhook generation the just one directory.

Signed-off-by: Todd Short <[email protected]>
@perdasilva perdasilva force-pushed the update-containters branch from 91c16b3 to 22199fb Compare March 6, 2025 09:17
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2025
@openshift-merge-robot
Copy link

PR needs rebase.

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants