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

Set NodeSet.Status.DeployedVersion when update service is complete #899

Conversation

slagle
Copy link
Contributor

@slagle slagle commented Jul 1, 2024

Set NodeSet.Status.DeployedVersion when update service is complete

Changes setting NodeSet.Status.DeployedVersion to be only when a
Deployment has completed that contains a service where EDPMServiceType
== 'update'. When satisfied, the Deployment's Status.DeployedVersion
will be copied to NodeSet.Status.DeployedVersion.

Jira: https://issues.redhat.com/browse/OSPRH-8176
Signed-off-by: James Slagle [email protected]

@openshift-ci openshift-ci bot requested review from abays and stuggi July 1, 2024 18:06
@openshift-ci openshift-ci bot added the approved label Jul 1, 2024

// DataplaneNodesetsUpdated returns true if all nodesets are deployed with the latest version
func DataplaneNodesetsUpdated(ctx context.Context, helper *helper.Helper, version *corev1beta1.OpenStackVersion, dataplaneNodesets *dataplanev1.OpenStackDataPlaneNodeSetList) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

this will get called repeatedly during a minor update until it reconciles. while this may work in some cases it also depends on DataplaneNodeSet to trigger a reconcile loop on OpenStackVersion (this is the only resource we are watching) and it is not as efficient as perhaps just having the OpenStackDataplaneNodeset controller do it (since it already watches Deployment anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I have reworked it to set a condition on the NodeSet instead, and just updated the func here to check that condition.

@slagle slagle force-pushed the dataplane-condition-update branch 2 times, most recently from c108b57 to c19f8a1 Compare July 1, 2024 20:15
@slagle slagle changed the title Add DataplaneNodesetsUpdated func Add NodeSetMinorUpdateReadyCondition to NodeSet Jul 1, 2024
@@ -62,7 +62,7 @@ func DataplaneNodesetsDeployed(version *corev1beta1.OpenStackVersion, dataplaneN
if !nodeset.IsReady() {
return false
}
if nodeset.Status.DeployedVersion != version.Spec.TargetVersion {
if !nodeset.Status.Conditions.IsTrue(dataplanev1.NodeSetMinorUpdateReadyCondition) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might need to check both of these right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The version check has already been done in the nodeset controller before the condition is set.

Copy link
Contributor

Choose a reason for hiding this comment

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

while that may be true, this function gets executed from the openstackversion side of things which could bump targetVersion. I am trying to guard against the case where the version changes, but in the interim this condition hasn't yet been reset

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworked so that this "if" condition will work without any changes.

pkg/openstack/dataplane.go Outdated Show resolved Hide resolved
@slagle slagle force-pushed the dataplane-condition-update branch from c19f8a1 to cfb4154 Compare July 2, 2024 17:55
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/032fdd4ff74b42548c172f28d801871d

openstack-k8s-operators-content-provider FAILURE in 7m 51s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ openstack-operator-tempest-multinode SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@slagle slagle force-pushed the dataplane-condition-update branch 3 times, most recently from faacaa8 to 4837c75 Compare July 2, 2024 21:42
@slagle slagle changed the title Add NodeSetMinorUpdateReadyCondition to NodeSet Set NodeSet.Status.DeployedVersion when update service is complete Jul 2, 2024
Changes setting NodeSet.Status.DeployedVersion to be only when a
Deployment has completed that contains a service where EDPMServiceType
== 'update'. When satisfied, the Deployment's Status.DeployedVersion
will be copied to NodeSet.Status.DeployedVersion.

Jira: https://issues.redhat.com/browse/OSPRH-8176
Signed-off-by: James Slagle <[email protected]>
@slagle slagle force-pushed the dataplane-condition-update branch from 4837c75 to c884797 Compare July 2, 2024 21:45
Copy link
Contributor

openshift-ci bot commented Jul 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprince, slagle

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-merge-bot openshift-merge-bot bot merged commit 06baa21 into openstack-k8s-operators:main Jul 3, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants