Skip to content

Commit

Permalink
Move registration back up again
Browse files Browse the repository at this point in the history
  • Loading branch information
eberlep committed Sep 16, 2024
1 parent b7da702 commit d5b98e8
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,25 @@ func main() {
}
// +kubebuilder:scaffold:builder

svcClusterMgr.GetWebhookServer().Register(
"/mutate-apps-v1-statefulset",
&webhook.Admission{
Handler: &webhooks.FsGroupChangePolicySetter{
SvcClient: svcClusterMgr.GetClient(),
Decoder: admission.NewDecoder(svcClusterMgr.GetScheme()),
Log: ctrl.Log.WithName("webhooks").WithName("FsGroupChangePolicySetter"),
},
},
)
// svcClusterMgr.GetWebhookServer().Register("/mutate-v1-pod", &webhook.Admission{Handler: &webhooks.PodAnnotator{Client: svcClusterMgr.GetClient(), Decoder: admission.NewDecoder(svcClusterMgr.GetScheme()), Log: ctrl.Log.WithName("webhooks").WithName("PodAnnotator")}})
// if err := builder.WebhookManagedBy(svcClusterMgr).
// For(&appsv1.StatefulSet{}).
// WithDefaulter(&webhooks.STSAnnotator{Log: ctrl.Log.WithName("webhooks").WithName("STSAnnotator")}).
// Complete(); err != nil {
// setupLog.Error(err, "unable to create webhook", "webhook", "StatefulSet")
// os.Exit(1)
// }

ctx := context.Background()

// update all existing operators to the current version
Expand All @@ -511,23 +530,4 @@ func main() {
os.Exit(1)
}

svcClusterMgr.GetWebhookServer().Register(
"/mutate-apps-v1-statefulset",
&webhook.Admission{
Handler: &webhooks.FsGroupChangePolicySetter{
SvcClient: svcClusterMgr.GetClient(),
Decoder: admission.NewDecoder(svcClusterMgr.GetScheme()),
Log: ctrl.Log.WithName("webhooks").WithName("FsGroupChangePolicySetter"),
},
},
)
// svcClusterMgr.GetWebhookServer().Register("/mutate-v1-pod", &webhook.Admission{Handler: &webhooks.PodAnnotator{Client: svcClusterMgr.GetClient(), Decoder: admission.NewDecoder(svcClusterMgr.GetScheme()), Log: ctrl.Log.WithName("webhooks").WithName("PodAnnotator")}})
// if err := builder.WebhookManagedBy(svcClusterMgr).
// For(&appsv1.StatefulSet{}).
// WithDefaulter(&webhooks.STSAnnotator{Log: ctrl.Log.WithName("webhooks").WithName("STSAnnotator")}).
// Complete(); err != nil {
// setupLog.Error(err, "unable to create webhook", "webhook", "StatefulSet")
// os.Exit(1)
// }

}

0 comments on commit d5b98e8

Please sign in to comment.