Skip to content

MCO-1590: Add explicit opt-out & status field for boot image update configuration #2223

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

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

djoshy
Copy link
Contributor

@djoshy djoshy commented Mar 10, 2025

This PR adds:

  • a new "None" enum to specifically exclude machine resources from boot image updates
  • a status field for ManagedBootImages that will reflect the spec.ManagedBootImages. If unspecified, it will display the cluster defaults

Scenario: No admin configuration and the current release does not opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
  managedBootImagesStatus:
    machineManagers:
    - resource: machinesets
      apiGroup: machine.openshift.io
      selection:
         mode: None

Scenario: No admin configuration and the current release does opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
  managedBootImagesStatus:
    machineManagers:
    - resource: machinesets
      apiGroup: machine.openshift.io
      selection:
         mode: All

Regardless of the default-on behavior of the release, if the admin were to add a configuration, the status must reflect that in the next update.

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
  managedBootImages:
    machineManagers:
    - resource: machinesets
      apiGroup: machine.openshift.io
      selection:
         mode: Partial
         partial:
           machineResourceSelector:
             matchLabels: {}
status:
  managedBootImagesStatus:
    machineManagers:
    - resource: machinesets
      apiGroup: machine.openshift.io
      selection:
         mode: Partial
         partial:
           machineResourceSelector:
             matchLabels: {}

Copy link
Contributor

openshift-ci bot commented Mar 10, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 10, 2025
Copy link
Contributor

openshift-ci bot commented Mar 10, 2025

Hello @djoshy! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 10, 2025
@djoshy djoshy changed the title [DNM] Add explicit opt-out for boot image update MCO-1590: Add explicit opt-out & status field for boot image update configuration Mar 11, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 11, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 11, 2025

@djoshy: This pull request references MCO-1590 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.19.0" version, but no target version was set.

In response to this:

Added for testing

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.

@djoshy djoshy marked this pull request as ready for review March 11, 2025 19:21
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 11, 2025
@openshift-ci openshift-ci bot requested review from deads2k and knobunc March 11, 2025 19:22
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 11, 2025

@djoshy: This pull request references MCO-1590 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.19.0" version, but no target version was set.

In response to this:

This PR adds:

  • a new "None" enum to specifically exclude machine resources from boot image updates
  • a status field for ManagedBootImages that will reflect the spec.ManagedBootImages. If unspecified, it will display the cluster defaults

Scenario: No admin configuration and the current release does not opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
 managedBootImagesStatus:
   machineManagers: []

Scenario: No admin configuration and the current release does opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
 managedBootImagesStatus:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: All

Regardless of the default-on behavior of the release, if the admin were to add a configuration, the status must reflect that in the next update.

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
 managedBootImages:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: Partial
        partial:
          machineResourceSelector:
            matchLabels: {}
status:
 managedBootImagesStatus:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: Partial
        partial:
          machineResourceSelector:
            matchLabels: {}

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
Copy link

openshift-ci-robot commented Mar 11, 2025

@djoshy: This pull request references MCO-1590 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.19.0" version, but no target version was set.

In response to this:

This PR adds:

  • a new "None" enum to specifically exclude machine resources from boot image updates
  • a status field for ManagedBootImages that will reflect the spec.ManagedBootImages. If unspecified, it will display the cluster defaults

Scenario: No admin configuration and the current release does not opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
 managedBootImagesStatus:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: None

Scenario: No admin configuration and the current release does opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
 managedBootImagesStatus:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: All

Regardless of the default-on behavior of the release, if the admin were to add a configuration, the status must reflect that in the next update.

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
 managedBootImages:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: Partial
        partial:
          machineResourceSelector:
            matchLabels: {}
status:
 managedBootImagesStatus:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: Partial
        partial:
          machineResourceSelector:
            matchLabels: {}

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
Copy link

openshift-ci-robot commented Mar 11, 2025

@djoshy: This pull request references MCO-1590 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.19.0" version, but no target version was set.

In response to this:

This PR adds:

  • a new "None" enum to specifically exclude machine resources from boot image updates
  • a status field for ManagedBootImages that will reflect the spec.ManagedBootImages. If unspecified, it will display the cluster defaults

Scenario: No admin configuration and the current release does not opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
 managedBootImagesStatus:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: None

Scenario: No admin configuration and the current release does opt-in by default:

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
status:
 managedBootImagesStatus:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: All

Regardless of the default-on behavior of the release, if the admin were to add a configuration, the status must reflect that in the next update.

apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
spec:
 managedBootImages:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: Partial
        partial:
          machineResourceSelector:
            matchLabels: {}
status:
 managedBootImagesStatus:
   machineManagers:
   - resource: machinesets
     apiGroup: machine.openshift.io
     selection:
        mode: Partial
        partial:
          machineResourceSelector:
            matchLabels: {}

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.

Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

One doc nit but otherwise LGTM

// always boot with the current cluster version's boot image. When omitted, no boot images
// will be updated.
// always boot with the current cluster version's boot image. When omitted, the MCO will
// will use cluster defaults, which may vary between releases.
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a particular way of wording this

Suggested change
// will use cluster defaults, which may vary between releases.
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
// The default is ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in last push!

@djoshy
Copy link
Contributor Author

djoshy commented Mar 12, 2025

Seeing failures from verify-crd-schema locally:

error running generator schemacheck on group operator.openshift.io: 
        could not run schemacheck generator for group/version operator.openshift.io/v1: 
                NoMaps: 
                        crd/machineconfigurations.operator.openshift.io version/v1 field/^.status.managedBootImagesStatus.machineManagers[*].selection.partial.machineResourceSelector.matchLabels may not be a map
                NoMaps: 
                        crd/machineconfigurations.operator.openshift.io version/v1 field/^.status.managedBootImagesStatus.machineManagers[*].selection.partial.machineResourceSelector.matchLabels may not be a map

I assume these are safe to ignore because managedBootImagesStatus is a new field?

@JoelSpeed
Copy link
Contributor

/override ci/prow/verify-crd-schema
/lgtm

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

openshift-ci bot commented Mar 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: djoshy, JoelSpeed

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 Mar 12, 2025
Copy link
Contributor

openshift-ci bot commented Mar 12, 2025

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/verify-crd-schema

In response to this:

/override ci/prow/verify-crd-schema
/lgtm

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.

@djoshy
Copy link
Contributor Author

djoshy commented Mar 12, 2025

/retest-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 14a17c7 and 2 for PR HEAD 378e9d7 in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 14a17c7 and 2 for PR HEAD 378e9d7 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 14a17c7 and 2 for PR HEAD 378e9d7 in total

@djoshy
Copy link
Contributor Author

djoshy commented Mar 13, 2025

/retest-required

Copy link
Contributor

openshift-ci bot commented Mar 13, 2025

@djoshy: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure 378e9d7 link false /test e2e-azure
ci/prow/e2e-gcp 378e9d7 link false /test e2e-gcp

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 8a7efbf into openshift:master Mar 13, 2025
21 of 23 checks passed
@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-config-api
This PR has been included in build ose-cluster-config-api-container-v4.19.0-202503131541.p0.g8a7efbf.assembly.stream.el9.
All builds following this will include this PR.

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants