From 6af734da0b0084a2f6b6d1003ba4733097f07cd2 Mon Sep 17 00:00:00 2001 From: Morteza E <105240903+mershad-manesh@users.noreply.github.com> Date: Tue, 28 Nov 2023 13:51:00 -0500 Subject: [PATCH] bug fixes --- horizon/templates/docker.secret.yaml | 3 ++- horizon/templates/opennms-core.clusterrole.yaml | 2 +- horizon/templates/opennms-core.clusterrolebinding.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/horizon/templates/docker.secret.yaml b/horizon/templates/docker.secret.yaml index f6206f7..fde4b2d 100644 --- a/horizon/templates/docker.secret.yaml +++ b/horizon/templates/docker.secret.yaml @@ -1,4 +1,5 @@ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +{{- $namespace := include "namespace" . }} {{- range $k, $r := .Values.imagePullSecrets }} # TODO: find a better way to format this JSON that won't be sensitive to special characters {{- $json := printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" $r.dockerServer $r.dockerUsername $r.dockerPassword $r.dockerEmail (printf "%s:%s" $r.dockerUsername $r.dockerPassword | b64enc) }} @@ -8,7 +9,7 @@ kind: Secret type: kubernetes.io/dockerconfigjson metadata: name: {{ $r.name }} - namespace: {{ include "grafana.namespace" . }} + namespace: {{ $namespace }} data: .dockerconfigjson: {{ $json | b64enc }} {{- end }} diff --git a/horizon/templates/opennms-core.clusterrole.yaml b/horizon/templates/opennms-core.clusterrole.yaml index 60756b4..8510abe 100644 --- a/horizon/templates/opennms-core.clusterrole.yaml +++ b/horizon/templates/opennms-core.clusterrole.yaml @@ -1,4 +1,4 @@ -{{- if and (eq (include "onOpenShift" .) "true") (.Values.dependencies.clusterRoleBinding) }} +{{- if and (eq (include "onOpenShift" .) "true") (.Values.dependencies.clusterRole) }} kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: diff --git a/horizon/templates/opennms-core.clusterrolebinding.yaml b/horizon/templates/opennms-core.clusterrolebinding.yaml index 38b7a56..35fc0e9 100644 --- a/horizon/templates/opennms-core.clusterrolebinding.yaml +++ b/horizon/templates/opennms-core.clusterrolebinding.yaml @@ -1,4 +1,4 @@ -{{- if and (eq (include "onOpenShift" .) "true") (.Values.dependencies.clusterRole) }} +{{- if and (eq (include "onOpenShift" .) "true") (.Values.dependencies.clusterRoleBinding) }} kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: