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

CM-424: Allow feature specific controller gating for operator TechPreview features #229

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

swghosh
Copy link
Member

@swghosh swghosh commented Jan 8, 2025

  • adds API field for enabling (operator-specific) experimental TechPreview features
  • enable IstioCSR controller only when the feature is enabled
  • controller to watch the TechPreview features and update OLM OperatorCondition with overrides Upgradeable: false (block operator upgrades)

dynamically starting controllers after controller-runtime has started: kubernetes-sigs/controller-runtime#1994 (comment).

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 8, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 8, 2025

@swghosh: This pull request references CM-424 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "cert-manager-1.15" instead.

In response to this:

  • adds API field for enabling (operator-specific) experimental TechPreview features
  • enable IstioCSR controller only when the feature is enabled
  • controller to watch the TechPreview features and update OLM OperatorCondition with overrides Upgradeable: false (block operator upgrades)

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from deads2k and TrilokGeer January 8, 2025 12:16
Copy link
Contributor

openshift-ci bot commented Jan 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: swghosh

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2025
@swghosh swghosh force-pushed the cm-424 branch 2 times, most recently from d47b9ea to 2af5796 Compare January 8, 2025 16:55
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 8, 2025

@swghosh: This pull request references CM-424 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "cert-manager-1.15" instead.

In response to this:

  • adds API field for enabling (operator-specific) experimental TechPreview features
  • enable IstioCSR controller only when the feature is enabled
  • controller to watch the TechPreview features and update OLM OperatorCondition with overrides Upgradeable: false (block operator upgrades)

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 openshift-eng/jira-lifecycle-plugin repository.

@swghosh
Copy link
Member Author

swghosh commented Jan 8, 2025

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 8, 2025

@swghosh: This pull request references CM-424 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "cert-manager-1.15" instead.

In response to this:

  • adds API field for enabling (operator-specific) experimental TechPreview features
  • enable IstioCSR controller only when the feature is enabled
  • controller to watch the TechPreview features and update OLM OperatorCondition with overrides Upgradeable: false (block operator upgrades)

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 openshift-eng/jira-lifecycle-plugin repository.

@swghosh swghosh force-pushed the cm-424 branch 2 times, most recently from a2306c2 to cbacb19 Compare January 8, 2025 22:24
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 9, 2025

@swghosh: This pull request references CM-424 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "cert-manager-1.15" instead.

In response to this:

  • adds API field for enabling (operator-specific) experimental TechPreview features
  • enable IstioCSR controller only when the feature is enabled
  • controller to watch the TechPreview features and update OLM OperatorCondition with overrides Upgradeable: false (block operator upgrades)

dynamically starting controllers after controller-runtime has started: kubernetes-sigs/controller-runtime#1994 (comment).

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 openshift-eng/jira-lifecycle-plugin repository.

// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile
// Reconcile is run each time the CertManager object has a create/update/delete event.
// All objects other than certmanager.operator.openshift.io/cluster lead to no-op syncs.
func (r *CertManagerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We could add couple of UTs here I think.

fc.log.V(1).Info("graceful shutdown")
return

case <-time.Tick(retryInterval):
Copy link
Contributor

Choose a reason for hiding this comment

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

not a blocker, instead of periodic poll, could we share a channel between Reconcile and RunWithManagerOnceEnabled methods, say a new field in CertManagerReconciler and as arg to the later method, and wait on the channel for updates?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added an event watcher to the FeatureAccessor, which takes care of doing the similar. Events are sent by the feature accessor when a new feature is enabled, this is subscribed by the RunWithManagerOnceEnabled method which triggers enablement accordingly.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 11, 2025
to pkg/controller/certmanager

Signed-off-by: Swarup Ghosh <[email protected]>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2025
@swghosh swghosh force-pushed the cm-424 branch 3 times, most recently from 8f80c5e to 2f28502 Compare February 14, 2025 13:02
@swghosh
Copy link
Member Author

swghosh commented Feb 14, 2025

Updated the implementation for the FeatureAccessor to wrap with an k8s.io/component-base/featuregate 's MutableFeatureGate. This provides us the additional functionality to promote a TechPreview feature to GA in a new release, i.e. flip the switch between a feauture being disabled by default -> enabled by default from a single point of control.

@swghosh swghosh changed the title CM-424: Optional TechPreview operator features CM-424: Allow feature specific controller gating for operator TechPreview features Feb 14, 2025
- reconcile certmanager.operator CR with ctrl runtime (feature gates enable check)
- add feature_controller_set with ManagedController(s)

Signed-off-by: Swarup Ghosh <[email protected]>
@bharath-b-rh
Copy link
Contributor

/test verify-deps

allows using envtest tools for CRD validation tests

Signed-off-by: Swarup Ghosh <[email protected]>
through envtest based CRD validation

Signed-off-by: Swarup Ghosh <[email protected]>
Copy link
Contributor

openshift-ci bot commented Feb 25, 2025

@swghosh: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants