File tree Expand file tree Collapse file tree 5 files changed +17
-8
lines changed
Expand file tree Collapse file tree 5 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ require (
88 github.com/metal3-io/baremetal-operator/apis v0.6.3
99 github.com/onsi/ginkgo/v2 v2.20.1
1010 github.com/onsi/gomega v1.34.1
11- github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97
11+ github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250414142358-93cd2db6b160
1212 k8s.io/api v0.29.14
1313 k8s.io/apimachinery v0.29.14
1414 sigs.k8s.io/controller-runtime v0.17.6
Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo
8888github.com/onsi/ginkgo/v2 v2.20.1 /go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI =
8989github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k =
9090github.com/onsi/gomega v1.34.1 /go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY =
91- github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97 h1:3LC66vrXJzGMV/eCdvImosOEL2Cgc2KFJIm2YhfTG3w =
92- github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97 /go.mod h1:rgpcv2tLD+/vudXx/gpIQSTuRpk4GOxHx84xwfvQalM =
91+ github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250414142358-93cd2db6b160 h1:7l70xtCoyyz6kjMTSBdL4+4yUhZBrAVWLLzB7w+yhD4 =
92+ github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250414142358-93cd2db6b160 /go.mod h1:rgpcv2tLD+/vudXx/gpIQSTuRpk4GOxHx84xwfvQalM =
9393github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4 =
9494github.com/pkg/errors v0.9.1 /go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0 =
9595github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
Original file line number Diff line number Diff line change @@ -422,8 +422,17 @@ func (r *OpenStackProvisionServerReconciler) reconcileNormal(ctx context.Context
422422 condition .DeploymentReadyRunningMessage ))
423423 return ctrlResult , nil
424424 }
425- instance .Status .ReadyCount = depl .GetDeployment ().Status .ReadyReplicas
426- if instance .Status .ReadyCount > 0 {
425+ deploy := depl .GetDeployment ()
426+ if deploy .Generation == deploy .Status .ObservedGeneration {
427+ instance .Status .ReadyCount = deploy .Status .ReadyReplicas
428+ }
429+ // Mark the Deployment as Ready only if the number of Replicas is equals
430+ // to the Deployed instances (ReadyCount), and the the Status.Replicas
431+ // match Status.ReadyReplicas. If a deployment update is in progress,
432+ // Replicas > ReadyReplicas.
433+ // In addition, make sure the controller sees the last Generation
434+ // by comparing it with the ObservedGeneration.
435+ if deployment .IsReady (deploy ) {
427436 instance .Status .Conditions .MarkTrue (condition .DeploymentReadyCondition , condition .DeploymentReadyMessage )
428437 } else {
429438 instance .Status .Conditions .Set (condition .FalseCondition (
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ require (
1010 github.com/metal3-io/baremetal-operator/apis v0.6.3
1111 github.com/onsi/ginkgo/v2 v2.20.1
1212 github.com/onsi/gomega v1.34.1
13- github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97
13+ github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250414142358-93cd2db6b160
1414 github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.0.0-00010101000000-000000000000
1515 github.com/spf13/cobra v1.9.1
1616 k8s.io/api v0.29.14
Original file line number Diff line number Diff line change @@ -99,8 +99,8 @@ github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
9999github.com/onsi/gomega v1.34.1 /go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY =
100100github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 h1:J1wuGhVxpsHykZBa6Beb1gQ96Ptej9AE/BvwCBiRj1E =
101101github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 /go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4 =
102- github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97 h1:3LC66vrXJzGMV/eCdvImosOEL2Cgc2KFJIm2YhfTG3w =
103- github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250228124213-cd63da392f97 /go.mod h1:rgpcv2tLD+/vudXx/gpIQSTuRpk4GOxHx84xwfvQalM =
102+ github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250414142358-93cd2db6b160 h1:7l70xtCoyyz6kjMTSBdL4+4yUhZBrAVWLLzB7w+yhD4 =
103+ github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250414142358-93cd2db6b160 /go.mod h1:rgpcv2tLD+/vudXx/gpIQSTuRpk4GOxHx84xwfvQalM =
104104github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4 =
105105github.com/pkg/errors v0.9.1 /go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0 =
106106github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
You can’t perform that action at this time.
0 commit comments