Skip to content

Commit daebc00

Browse files
Merge pull request #5493 from openshift/fix-pki-condition-update
OCPBUGS-48519: fix overwriting PKI operator HCP conditions
2 parents 55c2de5 + e00ef43 commit daebc00

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func NewCertRotationController(
132132
},
133133
},
134134
eventRecorder,
135-
clienthelpers.NewHostedControlPlaneStatusReporter(hostedControlPlane.Name, hostedControlPlane.Namespace, hypershiftClient),
135+
clienthelpers.NewHostedControlPlaneStatusReporter(hostedControlPlane.Name, hostedControlPlane.Namespace, rotatorName, hypershiftClient),
136136
)
137137
ret.certRotators = append(ret.certRotators, certRotator)
138138

@@ -190,7 +190,7 @@ func NewCertRotationController(
190190
},
191191
},
192192
eventRecorder,
193-
clienthelpers.NewHostedControlPlaneStatusReporter(hostedControlPlane.Name, hostedControlPlane.Namespace, hypershiftClient),
193+
clienthelpers.NewHostedControlPlaneStatusReporter(hostedControlPlane.Name, hostedControlPlane.Namespace, sreRotatorName, hypershiftClient),
194194
)
195195
ret.certRotators = append(ret.certRotators, sreCertRotator)
196196

control-plane-pki-operator/clienthelpers/conditions.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ import (
1616
clientgoapplyconfig "k8s.io/client-go/applyconfigurations/meta/v1"
1717
)
1818

19-
func NewHostedControlPlaneStatusReporter(name, namespace string, client hypershiftv1beta1client.HostedControlPlanesGetter) *HostedControlPlaneStatusReporter {
19+
func NewHostedControlPlaneStatusReporter(name, namespace, rotator string, client hypershiftv1beta1client.HostedControlPlanesGetter) *HostedControlPlaneStatusReporter {
2020
return &HostedControlPlaneStatusReporter{
2121
namespace: namespace,
2222
name: name,
23+
rotator: rotator,
2324
client: client,
2425
}
2526
}
@@ -28,6 +29,9 @@ type HostedControlPlaneStatusReporter struct {
2829
// namespace, name identify the HostedControlPlane we report to
2930
namespace, name string
3031

32+
// name of the rotating controller
33+
rotator string
34+
3135
client hypershiftv1beta1client.HostedControlPlanesGetter
3236
}
3337

@@ -43,7 +47,7 @@ func (h *HostedControlPlaneStatusReporter) Report(ctx context.Context, condition
4347
newCondition.Message = syncErr.Error()
4448
}
4549

46-
return UpdateHostedControlPlaneStatusCondition(ctx, newCondition, h.namespace, h.name, "cert-rotation-controller", h.client)
50+
return UpdateHostedControlPlaneStatusCondition(ctx, newCondition, h.namespace, h.name, h.rotator+"-cert-rotation-controller", h.client)
4751
}
4852

4953
var _ certrotation.StatusReporter = (*HostedControlPlaneStatusReporter)(nil)

0 commit comments

Comments
 (0)