Skip to content

Conversation

naseerahkani
Copy link
Contributor

- What I did
Updating MCO code to reflect changing from API to support Image Mode Status Reporting

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 14, 2025

@naseerahkani: This pull request references MCO-1713 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:

- What I did
Updating MCO code to reflect changing from API to support Image Mode Status Reporting

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 Jul 14, 2025
@openshift-merge-robot
Copy link
Contributor

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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 14, 2025
Copy link
Contributor

openshift-ci bot commented Jul 14, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: naseerahkani
Once this PR has been reviewed and has the lgtm label, please assign rishabhsaini for approval. For more information see the 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

Comment on lines 811 to 816
//Add: check if image mode status reporting fg is enables and if yes, use 821-826 as a guideline for configImage initialization
if fg.Enabled(features.FeatureGateImageModeStatusReporting) {
newMCS.Spec.ConfigImage = mcfgv1.MachineConfigNodeSpecConfigImage{
DesiredImage: mcfgv1.ImageDigestFormat(node.Annotations[daemonconsts.DesiredImageAnnotationKey]),
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think how we handle this depends on the decision made this thread on the API review (openshift/api#2383) on whether the configImage value is required or not and what it means for whether OCL is enabled or not.

If configImage should only be present when OCL is enabled (when a node generally has a desiredImage or current Image annotation), then I'd lean towards

  • If either annotation is not nil --> set the desired image ref since image mode is enabled
  • If both annotations are nil --> OCL not enabled, so don't set this object

Comment on lines 837 to 844
if fg.Enabled(features.FeatureGateImageModeStatusReporting) {
if mcn.Spec.ConfigImage.DesiredImage == upgrademonitor.NotYetSet {
err = upgrademonitor.GenerateAndApplyMachineConfigNodeSpec(optr.fgAccessor, pool, node, optr.client)
if err != nil {
klog.Errorf("Error making MCN spec for Update Compatible: %v", err)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this duplicative of lines 829-835? If I'm understanding this added conditional correctly, GenerateAndApplyMachineConfigNodeSpec would be called twice if both mcn.Spec.ConfigVersion.Desired and mcn.Spec.ConfigImage.DesiredImage are not yet set. Two questions on this:

  1. Will the desired image value ever be not-yet-set? If so, I'm not sure that's a fair representation of the desiredImage annotation not existing for a node.
  2. Should this be combined with the previous similar check to be something like if mcn.Spec.ConfigVersion.Desired == upgrademonitor.NotYetSet || mcn.Spec.ConfigImage.DesiredImage == <empty-status-value> (where depends on the answer to no. 1) to decrease the extra GenerateAndApplyMachineConfigNodeSpec call?

Comment on lines +299 to +302
statusConfigImageApplyImage := machineconfigurationv1.MachineConfigNodeStatusConfigImage().WithDesiredImage(newMCNode.Status.ConfigImage.DesiredImage)
if node.Annotations[daemonconsts.CurrentImageAnnotationKey] != "" {
statusConfigImageApplyImage = statusConfigImageApplyImage.WithCurrentImage(newMCNode.Status.ConfigImage.CurrentImage)
}
Copy link
Member

Choose a reason for hiding this comment

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

Question: Why does current image have a nil check, but desired does not?

Comment on lines 326 to 328
if newMCNode.Spec.ConfigImage.DesiredImage == "" {
newMCNode.Spec.ConfigImage.DesiredImage = ""
}
Copy link
Member

Choose a reason for hiding this comment

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

This does not seem like it would make any change.

}
// check if it should be empty
if newMCNode.Spec.ConfigImage.DesiredImage == "" {
newMCNode.Spec.ConfigVersion.Desired = NotYetSet
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this may be a copy-paste issue, as I'd expect this to be newMCNode.Spec.ConfigImage.Desired, not newMCNode.Spec.ConfigVersion.Desired.

However, do we want to make the config image values not-yet-set if they are nil, or just leave them empty, I figured we'd leave it empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can fix the copy-paste issue. As for the config image value, I put it down as NotYetSet temporarily and depending on how the API changes are finalized, I planned on going back and updating it to empty. Do you think this would be a good approach?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, let's revisit once the API Is finalized.

_, newOCLImage := extractOCLImageFromMachineConfig(newConfig)
err = upgrademonitor.GenerateAndApplyMachineConfigNodes(
&upgrademonitor.Condition{State: mcfgv1.MachineConfigNodeUpdateExecuted, Reason: string(mcfgv1.MachineConfigNodeImagePulledFromRegistry), Message: fmt.Sprintf("Image %s pulled from registry.", newOCLImage)},
&upgrademonitor.Condition{State: mcfgv1.MachineConfigNodeImagePulledFromRegistry, Reason: fmt.Sprintf("%s%s", string(mcfgv1.MachineConfigNodeUpdateExecuted), string(mcfgv1.MachineConfigNodeImagePulledFromRegistry)), Message: fmt.Sprintf("ask message")},
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey, it looks like this message "ask message" might be a placeholder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, do you have any suggestions on the message that should be produced?

Copy link
Contributor

Choose a reason for hiding this comment

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

anything that signifies that the image was pulled!

klog.Errorf("Error making MCN spec for Update Compatible: %v", err)
}

_, newOCLImage := extractOCLImageFromMachineConfig(newConfig)
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is responsible for extracting the ocl image from the mc if it exists. I think that function should work, buttt I'm not sure that this reporting should go here for a couple of reasons.

  1. The update workflow is agnostic to OCL, meaning there will be times when we go through this MCD update when we aren't even opted into OCL. Thus, we will be returning empty strings that can cause confusing status messages (so we want to make sure we handle this case).
  2. Also, i think the placement of this is premature because we could be status reporting before the correct image is in place.

I think update is a good place to put this work but we just want to ensure the timing is correct!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add code to handle the empty string case but where do you recommend adding this?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe after applyOSChanges has succeeded- meaning the image was pulled and the OS was rebased successfully.

Copy link
Contributor

openshift-ci bot commented Aug 4, 2025

@naseerahkani: 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/okd-images ae76087 link true /test okd-images
ci/prow/e2e-gcp-op 8a455ca link true /test e2e-gcp-op
ci/prow/e2e-azure-upgrade 8a455ca link false /test e2e-azure-upgrade
ci/prow/e2e-ovirt-upgrade 8a455ca link false /test e2e-ovirt-upgrade
ci/prow/e2e-aws-ovn-workers-rhel8 8a455ca link false /test e2e-aws-ovn-workers-rhel8
ci/prow/e2e-gcp-ovn-rt-upgrade 8a455ca link false /test e2e-gcp-ovn-rt-upgrade
ci/prow/e2e-openstack-externallb 8a455ca link false /test e2e-openstack-externallb
ci/prow/e2e-metal-ipi-ovn-ipv6 8a455ca link false /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-openstack-parallel 8a455ca link false /test e2e-openstack-parallel
ci/prow/e2e-vsphere-ovn-upi-zones 8a455ca link false /test e2e-vsphere-ovn-upi-zones
ci/prow/e2e-vsphere 8a455ca link false /test e2e-vsphere
ci/prow/e2e-aws-workers-rhel8 8a455ca link false /test e2e-aws-workers-rhel8
ci/prow/e2e-gcp-upgrade 8a455ca link false /test e2e-gcp-upgrade
ci/prow/e2e-gcp-single-node 8a455ca link false /test e2e-gcp-single-node
ci/prow/e2e-metal-ipi-ovn-dualstack 8a455ca link false /test e2e-metal-ipi-ovn-dualstack
ci/prow/e2e-vsphere-ovn-upi 8a455ca link false /test e2e-vsphere-ovn-upi
ci/prow/e2e-vsphere-ovn-zones 8a455ca link false /test e2e-vsphere-ovn-zones
ci/prow/e2e-aws-upgrade-single-node 8a455ca link false /test e2e-aws-upgrade-single-node
ci/prow/e2e-metal-assisted 8a455ca link false /test e2e-metal-assisted
ci/prow/e2e-aws-disruptive 8a455ca link false /test e2e-aws-disruptive
ci/prow/e2e-gcp-op-techpreview 8a455ca link false /test e2e-gcp-op-techpreview
ci/prow/e2e-aws-proxy 8a455ca link false /test e2e-aws-proxy
ci/prow/e2e-ovirt 8a455ca link false /test e2e-ovirt
ci/prow/e2e-aws-single-node 8a455ca link false /test e2e-aws-single-node
ci/prow/e2e-vsphere-upgrade 8a455ca link false /test e2e-vsphere-upgrade
ci/prow/e2e-azure 8a455ca link false /test e2e-azure
ci/prow/e2e-ovn-step-registry 8a455ca link false /test e2e-ovn-step-registry
ci/prow/e2e-azure-ovn-upgrade 74536f4 link false /test e2e-azure-ovn-upgrade
ci/prow/verify-deps 74536f4 link true /test verify-deps
ci/prow/okd-scos-images 74536f4 link true /test okd-scos-images
ci/prow/okd-scos-e2e-aws-ovn 74536f4 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-hypershift 74536f4 link true /test e2e-hypershift
ci/prow/e2e-agent-compact-ipv4 74536f4 link false /test e2e-agent-compact-ipv4
ci/prow/bootstrap-unit 74536f4 link false /test bootstrap-unit
ci/prow/e2e-aws-ovn-windows 74536f4 link false /test e2e-aws-ovn-windows
ci/prow/e2e-aws-serial 74536f4 link false /test e2e-aws-serial
ci/prow/security 74536f4 link false /test security
ci/prow/e2e-gcp-op-1of2 74536f4 link true /test e2e-gcp-op-1of2
ci/prow/images 74536f4 link true /test images
ci/prow/e2e-aws-mco-disruptive 74536f4 link false /test e2e-aws-mco-disruptive
ci/prow/e2e-aws-ovn-upgrade 74536f4 link true /test e2e-aws-ovn-upgrade
ci/prow/unit 74536f4 link true /test unit
ci/prow/verify 74536f4 link true /test verify
ci/prow/e2e-gcp-mco-disruptive 74536f4 link false /test e2e-gcp-mco-disruptive
ci/prow/e2e-gcp-op-single-node 74536f4 link true /test e2e-gcp-op-single-node
ci/prow/e2e-gcp-op-2of2 74536f4 link true /test e2e-gcp-op-2of2
ci/prow/e2e-aws-ovn 74536f4 link true /test e2e-aws-ovn
ci/prow/e2e-aws-ovn-upgrade-out-of-change 74536f4 link false /test e2e-aws-ovn-upgrade-out-of-change
ci/prow/e2e-azure-ovn-upgrade-out-of-change 74536f4 link false /test e2e-azure-ovn-upgrade-out-of-change
ci/prow/e2e-gcp-op-ocl 74536f4 link false /test e2e-gcp-op-ocl

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