Skip to content

Commit

Permalink
fix: Add missing AfterControlPlaneUpgradeLifecycleHandler interface (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson authored Aug 22, 2023
1 parent ba830d7 commit 7297882
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/runtimehooks/webhooks/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ func (s *Server) Start(ctx context.Context) error {
}
}

if t, ok := h.(handlers.AfterControlPlaneUpgradeLifecycleHandler); ok {
if err := webhookServer.AddExtensionHandler(server.ExtensionHandler{
Hook: runtimehooksv1.AfterControlPlaneUpgrade,
Name: h.Name(),
HandlerFunc: t.AfterControlPlaneUpgrade,
}); err != nil {
setupLog.Error(err, "error adding handler")
return err
}
}

if t, ok := h.(handlers.BeforeClusterDeleteLifecycleHandler); ok {
if err := webhookServer.AddExtensionHandler(server.ExtensionHandler{
Hook: runtimehooksv1.BeforeClusterDelete,
Expand Down
7 changes: 7 additions & 0 deletions pkg/handlers/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ type BeforeClusterUpgradeLifecycleHandler interface {
*runtimehooksv1.BeforeClusterUpgradeResponse,
)
}
type AfterControlPlaneUpgradeLifecycleHandler interface {
AfterControlPlaneUpgrade(
context.Context,
*runtimehooksv1.AfterControlPlaneUpgradeRequest,
*runtimehooksv1.AfterControlPlaneUpgradeResponse,
)
}
type BeforeClusterDeleteLifecycleHandler interface {
BeforeClusterDelete(
context.Context,
Expand Down

0 comments on commit 7297882

Please sign in to comment.