Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
secretKeyRef:
key: SERVICE_PASSWORD
name: {{ include "openstack-hypervisor-operator.fullname" . }}-secret
- name: CERTIFICATE_NAMESPACE
value: {{ quote .Values.controllerManager.manager.env.certificateNamespace }}
- name: CERTIFICATE_ISSUER_NAME
value: {{ quote .Values.controllerManager.manager.env.certificateIssuerName }}
- name: LABEL_SELECTOR
Expand Down
4 changes: 3 additions & 1 deletion charts/openstack-hypervisor-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ controllerManager:
- --metrics-bind-address=:8443
- --leader-elect
- --health-probe-bind-address=:8081
- --certificate-namespace=$(CERTIFICATE_NAMESPACE)
- --certificate-issuer-name=$(CERTIFICATE_ISSUER_NAME)
- --label-selector=$(LABEL_SELECTOR)
containerSecurityContext:
Expand All @@ -12,7 +13,8 @@ controllerManager:
drop:
- ALL
env:
certificateIssuerName: ""
certificateIssuerName: nova-hypervisor-agents-ca-issuer
certificateNamespace: monsoon3
labelSelector: ""
osAuthUrl: ""
osProjectDomainName: ""
Expand Down
12 changes: 12 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package main
import (
"crypto/sha256"
"crypto/tls"
"errors"
"flag"
"fmt"
"os"
Expand Down Expand Up @@ -99,12 +100,23 @@ func main() {
flag.StringVar(&certificateIssuerName, "certificate-issuer-name", "nova-hypervisor-agents-ca-issuer",
"Name of the certificate issuer.")

if certificateIssuerName == "" {
setupLog.Error(errors.New("certificate-issuer-name cannot be empty"), "invalid certificate issuer name")
os.Exit(1)
}

if certificateNamespace == "" {
setupLog.Error(errors.New("certificate-namespace cannot be empty"), "invalid certificate namespace")
os.Exit(1)
}

opts := ctrlzap.Options{
Development: true,
TimeEncoder: zapcore.ISO8601TimeEncoder,
Encoder: logger.NewSanitzeReconcileErrorEncoder(zap.NewDevelopmentEncoderConfig()),
StacktraceLevel: zap.DPanicLevel,
}

opts.BindFlags(flag.CommandLine)
flag.Parse()

Expand Down
4 changes: 4 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
- args:
- --leader-elect
- --health-probe-bind-address=:8081
- --certificate-namespace=$(CERTIFICATE_NAMESPACE)
- --certificate-issuer-name=$(CERTIFICATE_ISSUER_NAME)
- --label-selector=$(LABEL_SELECTOR)
env:
Expand All @@ -75,7 +76,10 @@ spec:
secretKeyRef:
name: secret
key: SERVICE_PASSWORD
- name: CERTIFICATE_NAMESPACE
value: "monsoon3"
- name: CERTIFICATE_ISSUER_NAME
value: "nova-hypervisor-agents-ca-issuer"
- name: LABEL_SELECTOR
image: keppel.eu-de-1.cloud.sap/ccloud/openstack-hypervisor-operator:latest
name: manager
Expand Down