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 soltysh committed Nov 3, 2023
1 parent 58eb6a7 commit 100ea91
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/kubernetesservice/controller.go
Expand Up @@ -151,6 +151,8 @@ func (c *Controller) Run(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
5 changes: 5 additions & 0 deletions pkg/controlplane/controller/kubernetesservice/patch.go
@@ -0,0 +1,5 @@
package kubernetesservice

var KubeAPIServerEmitEventFn EventSinkFunc = nil

type EventSinkFunc func(eventType, reason, messageFmt string, args ...interface{})
1 change: 1 addition & 0 deletions pkg/controlplane/instance.go
Expand Up @@ -413,6 +413,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
GenericAPIServer: s,
ClusterAuthenticationInfo: c.ExtraConfig.ClusterAuthenticationInfo,
}
kubernetesservice.KubeAPIServerEmitEventFn = m.GenericAPIServer.Eventf

clientset, err := kubernetes.NewForConfig(c.GenericConfig.LoopbackClientConfig)
if err != nil {
Expand Down

0 comments on commit 100ea91

Please sign in to comment.