review: flip to WEBHOOK_ENABLED
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
This commit is contained in:
parent
d220ace26a
commit
deaec580af
|
@ -98,8 +98,8 @@ spec:
|
|||
- name: "WEBHOOK_SERVICE_PORT"
|
||||
value: "9443"
|
||||
{{- else }}
|
||||
- name: "WEBHOOK_DISABLED"
|
||||
value: "true"
|
||||
- name: "WEBHOOK_ENABLED"
|
||||
value: "false"
|
||||
{{- end }}
|
||||
{{- if $externalSecretStoresEnabled }}
|
||||
- name: "ESS_TLS_SERVER_SECRET_NAME"
|
||||
|
@ -164,8 +164,8 @@ spec:
|
|||
value: "/certs/{{ .Values.registryCaBundleConfig.key }}"
|
||||
{{- end}}
|
||||
{{- if not .Values.webhooks.enabled }}
|
||||
- name: "WEBHOOK_DISABLED"
|
||||
value: "true"
|
||||
- name: "WEBHOOK_ENABLED"
|
||||
value: "false"
|
||||
{{- end }}
|
||||
- name: "TLS_SERVER_SECRET_NAME"
|
||||
value: crossplane-tls-server
|
||||
|
|
|
@ -96,7 +96,7 @@ type startCommand struct {
|
|||
PollInterval time.Duration `help:"How often individual resources will be checked for drift from the desired state." default:"1m"`
|
||||
MaxReconcileRate int `help:"The global maximum rate per second at which resources may checked for drift from the desired state." default:"10"`
|
||||
|
||||
WebhookDisabled bool `help:"Disable webhook configuration." env:"WEBHOOK_DISABLED"`
|
||||
WebhookEnabled bool `help:"Enable webhook configuration." default:"true" env:"WEBHOOK_ENABLED"`
|
||||
|
||||
TLSServerSecretName string `help:"The name of the TLS Secret that will store Crossplane's server certificate." env:"TLS_SERVER_SECRET_NAME"`
|
||||
TLSServerCertsDir string `help:"The path of the folder which will store TLS server certificate of Crossplane." env:"TLS_SERVER_CERTS_DIR"`
|
||||
|
@ -293,7 +293,7 @@ func (c *startCommand) Run(s *runtime.Scheme, log logging.Logger) error { //noli
|
|||
|
||||
// Registering webhooks with the manager is what actually starts the webhook
|
||||
// server.
|
||||
if !c.WebhookDisabled {
|
||||
if c.WebhookEnabled {
|
||||
// TODO(muvaf): Once the implementation of other webhook handlers are
|
||||
// fleshed out, implement a registration pattern similar to scheme
|
||||
// registrations.
|
||||
|
|
|
@ -39,7 +39,7 @@ type initCommand struct {
|
|||
Namespace string `short:"n" help:"Namespace used to set as default scope in default secret store config." default:"crossplane-system" env:"POD_NAMESPACE"`
|
||||
ServiceAccount string `help:"Name of the Crossplane Service Account." default:"crossplane" env:"POD_SERVICE_ACCOUNT"`
|
||||
|
||||
WebhookDisabled bool `help:"Disable webhook configuration." env:"WEBHOOK_DISABLED"`
|
||||
WebhookEnabled bool `help:"Enable webhook configuration." default:"true" env:"WEBHOOK_ENABLED"`
|
||||
WebhookServiceName string `help:"The name of the Service object that the webhook service will be run." env:"WEBHOOK_SERVICE_NAME"`
|
||||
WebhookServiceNamespace string `help:"The namespace of the Service object that the webhook service will be run." env:"WEBHOOK_SERVICE_NAMESPACE"`
|
||||
WebhookServicePort int32 `help:"The port of the Service that the webhook service will be run." env:"WEBHOOK_SERVICE_PORT"`
|
||||
|
@ -65,7 +65,7 @@ func (c *initCommand) Run(s *runtime.Scheme, log logging.Logger) error {
|
|||
initializer.TLSCertificateGeneratorWithClientSecretName(c.TLSClientSecretName, []string{fmt.Sprintf("%s.%s", c.ServiceAccount, c.Namespace)}),
|
||||
initializer.TLSCertificateGeneratorWithLogger(log.WithValues("Step", "TLSCertificateGenerator")),
|
||||
}
|
||||
if !c.WebhookDisabled {
|
||||
if c.WebhookEnabled {
|
||||
tlsGeneratorOpts = append(tlsGeneratorOpts,
|
||||
initializer.TLSCertificateGeneratorWithServerSecretName(c.TLSServerSecretName, initializer.DNSNamesForService(c.WebhookServiceName, c.WebhookServiceNamespace)))
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ func (c *initCommand) Run(s *runtime.Scheme, log logging.Logger) error {
|
|||
initializer.NewCoreCRDsMigrator("compositionrevisions.apiextensions.crossplane.io", "v1alpha1"),
|
||||
initializer.NewCoreCRDsMigrator("locks.pkg.crossplane.io", "v1alpha1"),
|
||||
)
|
||||
if !c.WebhookDisabled {
|
||||
if c.WebhookEnabled {
|
||||
nn := types.NamespacedName{
|
||||
Name: c.TLSServerSecretName,
|
||||
Namespace: c.Namespace,
|
||||
|
|
Loading…
Reference in New Issue