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

CSV: Add annotations into StrategyDeploymentSpec #350

Conversation

hongkailiu
Copy link

The intension is to add the annotations to the deployment ALM creates, like the labels.

@openshift-ci openshift-ci bot requested review from grokspawn and jmrodri July 2, 2024 16:54
Copy link

openshift-ci bot commented Jul 2, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hongkailiu
Once this PR has been reviewed and has the lgtm label, please assign joelanford for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

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

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 39.39%. Comparing base (ce8a923) to head (7601bc5).

Files Patch % Lines
pkg/operators/v1alpha1/zz_generated.deepcopy.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #350      +/-   ##
==========================================
- Coverage   39.43%   39.39%   -0.05%     
==========================================
  Files          56       56              
  Lines        4516     4521       +5     
==========================================
  Hits         1781     1781              
- Misses       2581     2586       +5     
  Partials      154      154              

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

@hongkailiu hongkailiu force-pushed the annotations_in_StrategyDeploymentSpec branch from a218ee6 to ee8365c Compare July 2, 2024 18:44
@hongkailiu hongkailiu force-pushed the annotations_in_StrategyDeploymentSpec branch from ee8365c to 7601bc5 Compare July 2, 2024 18:53
@kevinrizza
Copy link
Member

@hongkailiu Thanks for the contribution! Can you tell me the reason for this contribution? We're actively trying to move OLM v0 (which includes the CSV API) into a feature complete state, so we're trying to limit what gets added to the APIs at this point. What are you trying to solve for by adding hardcoded annotations to CSVs as opposed to using the subscription config at runtime on a cluster?

@kevinrizza
Copy link
Member

@hongkailiu Following along here https://issues.redhat.com/browse/OTA-1166 I think there's an even simpler option. OLM will propogate annotations defined on the CSV meta itself to the deployments it creates (see https://github.com/operator-framework/operator-lifecycle-manager/blob/master/pkg/controller/install/deployment.go#L147).

So you could just annotate the CSV instead of requiring an update to the API here. Let me know if that's sufficient, and if so I think this pull request isn't needed. We appreciate the work you put into it though!

@hongkailiu
Copy link
Author

Thanks @kevinrizza for the review.

My intension is this:
operator-framework/operator-lifecycle-manager#3339

And then:
I expect that the annotations from the manager of this controller
https://github.com/openshift/cincinnati-operator/pull/185/files#diff-ce0d597a9e5f20a8fe61c3ba5e6185a6b90cfef2c00bb5b5ef3e97b15b79f480R5
will appear in the CSV when it is generated by this command:

$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)

The goal of all this above is that when a deployment is created via the CSV, it has the annotation that we want.

I believe this is a similar PR for labels.
The current PR is for the annotations.

I am new to the operator world.
Feedback is appreciated if I did not do it correctly to achieve my goal above.

@hongkailiu
Copy link
Author

So you could just annotate the CSV instead of requiring an update to the API here. Let me know if that's sufficient, and if so I think this pull request isn't needed. We appreciate the work you put into it though!

I also found this while reading the code.
Let me try this and get back to you.
If it works out, i would consider it good enough for me.

@hongkailiu
Copy link
Author

It works. Thanks for the workaround. @kevinrizza

/close

@openshift-ci openshift-ci bot closed this Jul 2, 2024
Copy link

openshift-ci bot commented Jul 2, 2024

@hongkailiu: Closed this PR.

In response to this:

It works. Thanks for the workaround. @kevinrizza

/close

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants