Skip to content

Commit

Permalink
Use golang template variables for cert rotation knobs (#592)
Browse files Browse the repository at this point in the history
It will easy the operator implementation and the CNAO knmstate bump.

Signed-off-by: Quique Llorente <[email protected]>
  • Loading branch information
qinqon authored Aug 24, 2020
1 parent 0c0eaff commit f1c8aec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deploy/handler/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ spec:
- name: PROFILER_PORT
value: "6060"
- name: CA_ROTATE_INTERVAL
value: "8760h0m0s" # One Year
value: {{ .CARotateInterval | default "8760h0m0s" }}
- name: CA_OVERLAP_INTERVAL
value: "8760h0m0s" # One Year
value: {{ .CAOverlapInterval | default "8760h0m0s" }}
- name: CERT_ROTATE_INTERVAL
value: "4380h0m0s" # Half Year
value: {{ .CertRotateInterval | default "4380h0m0s" }}
ports:
- containerPort: 8443
name: webhook-server
Expand Down
5 changes: 5 additions & 0 deletions pkg/controller/nmstate/nmstate_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ func (r *ReconcileNMState) applyHandler(instance *nmstatev1beta1.NMState) error
data.Data["HandlerPullPolicy"] = os.Getenv("HANDLER_IMAGE_PULL_POLICY")
data.Data["HandlerPrefix"] = os.Getenv("HANDLER_PREFIX")
data.Data["HandlerNodeSelector"] = instance.Spec.NodeSelector
// TODO: This is just a place holder to make template renderer happy
// proper variable has to be read from env or CR
data.Data["CARotateInterval"] = ""
data.Data["CAOverlapInterval"] = ""
data.Data["CertRotateInterval"] = ""
return r.renderAndApply(instance, data, "handler", true)
}

Expand Down

0 comments on commit f1c8aec

Please sign in to comment.