Skip to content

Commit

Permalink
UPSTREAM: <carry>: emit event when readyz goes true
Browse files Browse the repository at this point in the history
OpenShift-Rebase-Source: 6386eb2
  • Loading branch information
deads2k authored and bertinatto committed Apr 11, 2023
1 parent 602c199 commit 55df8a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controlplane/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ func (c *Controller) RunKubernetesService(ch chan struct{}) {
return code == http.StatusOK, nil
}, ch)

kubeAPIServerEmitEventFn(corev1.EventTypeWarning, "KubeAPIReadyz", "readyz=true")

wait.NonSlidingUntil(func() {
// Service definition is not reconciled after first
// run, ports and type will be corrected only during
Expand Down
1 change: 1 addition & 0 deletions pkg/controlplane/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
GenericAPIServer: s,
ClusterAuthenticationInfo: c.ExtraConfig.ClusterAuthenticationInfo,
}
kubeAPIServerEmitEventFn = m.GenericAPIServer.Eventf

// install legacy rest storage

Expand Down
5 changes: 5 additions & 0 deletions pkg/controlplane/patch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package controlplane

var kubeAPIServerEmitEventFn EventSinkFunc = nil

type EventSinkFunc func(eventType, reason, messageFmt string, args ...interface{})

0 comments on commit 55df8a5

Please sign in to comment.