Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to disable admission webhooks #47

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ func main() {
enableLeaderElection bool
reconcileConcurrency int

enableAdmissionWebhookServer bool

metricProviderType string
promConfig promConfig
)
Expand All @@ -106,6 +108,7 @@ func main() {
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flag.IntVar(&reconcileConcurrency, "reconcile-concurrency", 1, "The reconciliation concurrency of each controller.")
flag.BoolVar(&enableAdmissionWebhookServer, "serve-admission-webhooks", true, "Enable admission webhook servers.")
flag.StringVar(&metricProviderType, "metric-provider", "prometheus",
"The name of metric provider. Valid options are prometheus or metrics-api. Defaults to prometheus.")
flag.StringVar(&promConfig.Address, "prometheus-address", "", "The address of the Prometheus to connect to.")
Expand Down Expand Up @@ -208,9 +211,11 @@ func main() {

externalHorizontalPortraitAlgorithmJobResultFetchers := initExternalHorizontalPortraitAlgorithmJobResultFetchers()

if err := webhook.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to set up webhook server")
os.Exit(1)
if enableAdmissionWebhookServer {
if err := webhook.SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to set up webhook server")
os.Exit(1)
}
}

if err := (&autoscaling.ReplicaProfileReconciler{
Expand Down