fix: Allow Helm dynamic overrides#1214
Conversation
|
@jcechace can you try this one please? |
899853c to
e30a4ca
Compare
|
@xstefank will give it a try this weekend. Sorry for the delay, it was a bit busier week than anticipated. I haven't forgotten though! |
| @@ -1,4 +1,4 @@ | |||
| {{ if eq $.Values.watchNamespaces "JOSDK_WATCH_CURRENT" }} | |||
| {{ if eq $.Values.app.envs.QUARKUS_OPERATOR_SDK_CONTROLLERS_EXPOSEDAPP_NAMESPACES "JOSDK_WATCH_CURRENT" }} | |||
There was a problem hiding this comment.
@xstefank this doesn't look right the envvar is named differently based on the controller name. Here it looks like you are hardcoding EXPOSEDAPP.
Also testing with my example operator, this is exactly the case
in values.yaml I have
app:
envs:
QUARKUS_OPERATOR_SDK_CONTROLLERS_WEBSITERECONCILER_NAMESPACES: JOSDK_ALL_NAMESPACES
But then later in websitereconciler-crd-role-binding.yaml
{{ if eq $.Values.app.envs.QUARKUS_OPERATOR_SDK_CONTROLLERS_EXPOSEDAPP_NAMESPACES "JOSDK_WATCH_CURRENT" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
|
@xstefank looks like we are getting there but one more mistake. |
Signed-off-by: xstefank <xstefank122@gmail.com>
Signed-off-by: xstefank <xstefank122@gmail.com>
Signed-off-by: xstefank <xstefank122@gmail.com>
e30a4ca to
9a4d697
Compare
|
@jcechace please take a look |
|
Merging this as this seems like a reasonable fix for now. Please open a new issue if this doesn't address your concerns and we'll issue a further fix later. |
|
Haven't had the chance to deploy but it seem to produce correct template files. |
| @@ -1,4 +1,4 @@ | |||
| {{ if eq $.Values.watchNamespaces "JOSDK_WATCH_CURRENT" }} | |||
| {{ if eq $.Values.app.envs.QUARKUS_OPERATOR_SDK_CONTROLLERS_{reconciler-name-uppercase}_NAMESPACES "JOSDK_WATCH_CURRENT" }} | |||
There was a problem hiding this comment.
This can cause issue if the reconciler name has '-' in it
Such as
@ControllerConfiguration(
name = "artifactory-secretsyncreconciler",
maxReconciliationInterval = @MaxReconciliationInterval(interval = 5, timeUnit = TimeUnit.MINUTES),
finalizerName = ArtifactorySecretSync.FINALIZER)Is invalid Helm template
{{ if eq $.Values.app.envs.QUARKUS_OPERATOR_SDK_CONTROLLERS_ARTIFACTORY-SECRETSYNCRECONCILER_NAMESPACES "JOSDK_WATCH_CURRENT" }}
artifactory-secretsyncreconciler-crd-role-binding.yaml:1): bad character U+002D '-'
No description provided.