diff --git a/bootstrap/api/v1beta2/kthreesconfig_webhook.go b/bootstrap/api/v1beta2/kthreesconfig_webhook.go index 4b1d2937..83d9f579 100644 --- a/bootstrap/api/v1beta2/kthreesconfig_webhook.go +++ b/bootstrap/api/v1beta2/kthreesconfig_webhook.go @@ -20,6 +20,7 @@ import ( "context" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" ) @@ -56,5 +57,12 @@ func (c *KThreesConfig) ValidateDelete(_ context.Context, _ runtime.Object) (adm // Default will set default values for the KThreesConfig. func (c *KThreesConfig) Default(_ context.Context, _ runtime.Object) error { + if c.Spec.ServerConfig.DisableCloudController == nil { + c.Spec.ServerConfig.DisableCloudController = ptr.To(true) + } + + if c.Spec.ServerConfig.CloudProviderName == nil { + c.Spec.ServerConfig.CloudProviderName = ptr.To("external") + } return nil }