Skip to content

OTA-1531: [6/6] cvo: use early gate checker to avoid delayed initialization #1196

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

petr-muller
Copy link
Member

@petr-muller petr-muller commented May 16, 2025

Previous changes prepared the code for this switch by adding code to detect enabled CVO gates and featureset early in the CVO execution, right before the controllers are initialized (well before CVO acquires its leader lease and actually starts the controllers). These early detected gate checker was not used anywhere yet.

This change makes CVO stop using its late detected gate checker (detected while loading its initial payload) and start using the early one instead. This eliminates the need for the panicking gate checker that was used to guard against checking gates before the actual checker could be established.

The change also allows to simplify some code layers. Late initialization on initial payload load is now only necessary for the actual CVO controller, not the featurechangestopper (it is already initialized at that time), so the Context layer does not need to coordinate anymore. The starting features set can be initialized in CVO right away, avoiding the need to wire it through call chains; it can simply be an Operator member.

Improve comments to clarify some concerns from earlier PR feedback.
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 16, 2025

@petr-muller: This pull request references OTA-1531 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 the "4.20.0" version, but no target version was set.

In response to this:

Previous changes prepared the code for this switch by adding code to detect
enabled CVO gates and featureset early in the CVO execution, right before
the controllers are initialized (well before CVO acquires its leader lease
and actually starts the controllers). These early detected gate checker
was not used anywhere yet.

This change makes CVO stop using its late detected gate checker (detected
while loading its initial payload) and start using the early one instead.
This eliminates the need for the panicking gate checker that was used to
guard against checking gates before the actual checker could be established.

The change also allows to simplify some code layers. Late initialization
on initial payload load is now only necessary for the actual CVO controller,
not the featurechangestopper (it is already initialized at that time), so
the Context layer does not need to coordinate anymore. The starting
features set can be initialized in CVO right away, avoiding the need
to wire it through call chains; it can simply be an Operator member.

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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 16, 2025
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 16, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 16, 2025

@petr-muller: This pull request references OTA-1531 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 the "4.20.0" version, but no target version was set.

In response to this:

Previous changes prepared the code for this switch by adding code to detect enabled CVO gates and featureset early in the CVO execution, right before the controllers are initialized (well before CVO acquires its leader lease and actually starts the controllers). These early detected gate checker was not used anywhere yet.

This change makes CVO stop using its late detected gate checker (detected while loading its initial payload) and start using the early one instead. This eliminates the need for the panicking gate checker that was used to guard against checking gates before the actual checker could be established.

The change also allows to simplify some code layers. Late initialization on initial payload load is now only necessary for the actual CVO controller, not the featurechangestopper (it is already initialized at that time), so the Context layer does not need to coordinate anymore. The starting features set can be initialized in CVO right away, avoiding the need to wire it through call chains; it can simply be an Operator member.

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.

@petr-muller
Copy link
Member Author

/retest

Previous changes prepared the code for this switch by adding code to detect
enabled CVO gates and featureset early in the CVO execution, right before
the controllers are initialized (well before CVO acquires its leader lease
and actually starts the controllers). These early detected gate checker
was not used anywhere yet.

This change makes CVO stop using its late detected gate checker (detected
while loading its initial payload) and start using the early one instead.
This eliminates the need for the panicking gate checker that was used to
guard against checking gates before the actual checker could be established.

The change also allows to simplify some code layers. Late initialization
on initial payload load is now only necessary for the actual CVO controller,
not the featurechangestopper (it is already initialized at that time), so
the `Context` layer does not need to coordinate anymore. The starting
features set can be initialized in CVO right away, avoiding the need
to wire it through call chains; it can simply be an `Operator` member.
@petr-muller petr-muller force-pushed the ota-1531-06-establish-gates-early branch from 1ae48cf to cb32cb8 Compare May 19, 2025 14:03
@petr-muller petr-muller changed the title OTA-1531: cvo: use early gate checker to avoid delayed initialization OTA-1531: [6/6] cvo: use early gate checker to avoid delayed initialization May 19, 2025
@hongkailiu
Copy link
Member

Late initialization
on initial payload load is now only necessary for the actual CVO controller,
not the featurechangestopper (it is already initialized at that time)

The meaning about the first of the sentence is not very clear to me without reading more about CVO controller.
But the 2nd half is clear in the pull.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 21, 2025
@petr-muller
Copy link
Member Author

/test e2e-agnostic-operator-devpreview

@petr-muller
Copy link
Member Author

/test e2e-agnostic-operator

@petr-muller
Copy link
Member Author

/test e2e-agnostic-operator-devpreview e2e-agnostic-operator

@petr-muller
Copy link
Member Author

/hold

ci/prow/e2e-agnostic-operator-devpreview is persistent and suspicious

@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 Jun 6, 2025
@petr-muller
Copy link
Member Author

/test ci/prow/e2e-agnostic-operator-techpreview

Copy link
Contributor

openshift-ci bot commented Jun 6, 2025

@petr-muller: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test e2e-agnostic-operator
/test e2e-agnostic-operator-techpreview
/test e2e-agnostic-ovn
/test e2e-agnostic-ovn-upgrade-into-change
/test e2e-agnostic-ovn-upgrade-into-change-techpreview
/test e2e-agnostic-ovn-upgrade-out-of-change
/test e2e-agnostic-ovn-upgrade-out-of-change-techpreview
/test e2e-aws-ovn-techpreview
/test e2e-hypershift
/test e2e-hypershift-conformance
/test gofmt
/test images
/test lint
/test unit
/test verify-deps
/test verify-update
/test verify-yaml

The following commands are available to trigger optional jobs:

/test e2e-agnostic-operator-devpreview
/test okd-scos-e2e-aws-ovn
/test okd-scos-images

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-cluster-version-operator-main-e2e-agnostic-operator
pull-ci-openshift-cluster-version-operator-main-e2e-agnostic-operator-devpreview
pull-ci-openshift-cluster-version-operator-main-e2e-agnostic-ovn
pull-ci-openshift-cluster-version-operator-main-e2e-agnostic-ovn-upgrade-into-change
pull-ci-openshift-cluster-version-operator-main-e2e-agnostic-ovn-upgrade-out-of-change
pull-ci-openshift-cluster-version-operator-main-e2e-aws-ovn-techpreview
pull-ci-openshift-cluster-version-operator-main-e2e-hypershift
pull-ci-openshift-cluster-version-operator-main-e2e-hypershift-conformance
pull-ci-openshift-cluster-version-operator-main-gofmt
pull-ci-openshift-cluster-version-operator-main-images
pull-ci-openshift-cluster-version-operator-main-lint
pull-ci-openshift-cluster-version-operator-main-okd-scos-e2e-aws-ovn
pull-ci-openshift-cluster-version-operator-main-unit
pull-ci-openshift-cluster-version-operator-main-verify-deps
pull-ci-openshift-cluster-version-operator-main-verify-update

In response to this:

/test ci/prow/e2e-agnostic-operator-techpreview

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.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2025
@petr-muller
Copy link
Member Author

/test e2e-agnostic-operator-techpreview

@petr-muller
Copy link
Member Author

/hold cancel

I made a mistake in tests, 14bd699 hopefully fixed it, operator tests are now expected to pass.

@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 Jun 6, 2025
@petr-muller
Copy link
Member Author

/retest-required

Copy link
Member

@hongkailiu hongkailiu left a comment

Choose a reason for hiding this comment

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

/lgtm

/hold

in case you want to address the nit and align the namings.
Free to cancel if you do not think it is worth another round of CI.

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jun 9, 2025
Bad naming got me here. I used the CV-specific informer factory instead of the generic one, resulting in tests always seeing the default featureset because of the `IsNotFound` branch after the GET.
@petr-muller petr-muller force-pushed the ota-1531-06-establish-gates-early branch from 14bd699 to c55bdea Compare June 10, 2025 15:10
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2025
@petr-muller
Copy link
Member Author

/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 Jun 10, 2025
@hongkailiu
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 10, 2025
Copy link
Contributor

openshift-ci bot commented Jun 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hongkailiu, petr-muller

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 [hongkailiu,petr-muller]

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

Copy link
Contributor

openshift-ci bot commented Jun 10, 2025

@petr-muller: 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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants