Skip to content

Commit

Permalink
Merge pull request #154 from mallardduck/charts-bug-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck authored Jan 28, 2025
2 parents b6cb682 + a74cece commit 008ee48
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
10 changes: 5 additions & 5 deletions charts/prometheus-federator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
{{- end }}

{{- define "prometheus-federator.imageTag" -}}
{{- if and .Values.image .Values.image.tag }}{{ .Values.image.tag }}
{{- else if and .Values.helmProjectOperator.image.tag }}{{ .Values.helmProjectOperator.image.tag }}
{{ else }}{{ .Chart.AppVersion }}
{{- end }}
{{- end }}
{{- if and .Values.image .Values.image.tag -}}{{- .Values.image.tag -}}
{{- else if and .Values.helmProjectOperator.image.tag -}}{{- .Values.helmProjectOperator.image.tag -}}
{{- else -}}{{- .Chart.AppVersion -}}
{{- end -}}
{{- end -}}

# Windows Support

Expand Down
8 changes: 4 additions & 4 deletions charts/prometheus-federator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if and .Values.helmProjectOperator.global.rbac.create .Values.helmProjectOperator.global.rbac.userRoles.create }}
{{- if and .Values.global.rbac.create .Values.global.rbac.userRoles.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "prometheus-federator.name" . }}-admin
labels: {{ include "prometheus-federator.labels" . | indent 4 }}
{{- if .Values.helmProjectOperator.global.rbac.userRoles.aggregateToDefaultRoles }}
{{- if .Values.global.rbac.userRoles.aggregateToDefaultRoles }}
rbac.authorization.k8s.io/aggregate-to-admin: "true"
{{- end }}
rules:
Expand All @@ -22,7 +22,7 @@ kind: ClusterRole
metadata:
name: {{ template "prometheus-federator.name" . }}-edit
labels: {{ include "prometheus-federator.labels" . | indent 4 }}
{{- if .Values.helmProjectOperator.global.rbac.userRoles.aggregateToDefaultRoles }}
{{- if .Values.global.rbac.userRoles.aggregateToDefaultRoles }}
rbac.authorization.k8s.io/aggregate-to-edit: "true"
{{- end }}
rules:
Expand All @@ -41,7 +41,7 @@ kind: ClusterRole
metadata:
name: {{ template "prometheus-federator.name" . }}-view
labels: {{ include "prometheus-federator.labels" . | indent 4 }}
{{- if .Values.helmProjectOperator.global.rbac.userRoles.aggregateToDefaultRoles }}
{{- if .Values.global.rbac.userRoles.aggregateToDefaultRoles }}
rbac.authorization.k8s.io/aggregate-to-view: "true"
{{- end }}
rules:
Expand Down
28 changes: 14 additions & 14 deletions charts/prometheus-federator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,38 @@ spec:
spec:
containers:
- name: {{ template "prometheus-federator.name" . }}
image: "{{ template "prometheus-federator.imageRegistry" . }}{{ template "prometheus-federator.imageRepository" . }}:{{ template "prometheus-federator.imageTag" . }}"
image: "{{- template "prometheus-federator.imageRegistry" . -}}{{- template "prometheus-federator.imageRepository" . -}}:{{- template "prometheus-federator.imageTag" . -}}"
imagePullPolicy: "{{ .Values.helmProjectOperator.image.pullPolicy }}"
args:
- {{ template "prometheus-federator.name" . }}
- --namespace={{ template "prometheus-federator.namespace" . }}
- --controller-name={{ template "prometheus-federator.name" . }}
- --values-override-file=/etc/helmprojectoperator/config/values.yaml
{{- if .Values.helmProjectOperator.global.cattle.systemDefaultRegistry }}
- --system-default-registry={{ .Values.helmProjectOperator.global.cattle.systemDefaultRegistry }}
{{- if .Values.global.cattle.systemDefaultRegistry }}
- --system-default-registry={{ .Values.global.cattle.systemDefaultRegistry }}
{{- end }}
{{- if .Values.helmProjectOperator.global.cattle.url }}
- --cattle-url={{ .Values.helmProjectOperator.global.cattle.url }}
{{- if .Values.global.cattle.url }}
- --cattle-url={{ .Values.global.cattle.url }}
{{- end }}
{{- if .Values.helmProjectOperator.global.cattle.projectLabel }}
- --project-label={{ .Values.helmProjectOperator.global.cattle.projectLabel }}
{{- if .Values.global.cattle.projectLabel }}
- --project-label={{ .Values.global.cattle.projectLabel }}
{{- end }}
{{- if not .Values.helmProjectOperator.projectReleaseNamespaces.enabled }}
- --system-project-label-values={{ join "," (append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.helmProjectOperator.global.cattle.systemProjectId) }}
{{- else if and (ne (len .Values.helmProjectOperator.global.cattle.systemProjectId) 0) (ne (len .Values.helmProjectOperator.projectReleaseNamespaces.labelValue) 0) (ne .Values.helmProjectOperator.projectReleaseNamespaces.labelValue .Values.helmProjectOperator.global.cattle.systemProjectId) }}
- --system-project-label-values={{ join "," (append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.helmProjectOperator.global.cattle.systemProjectId) }}
- --system-project-label-values={{ join "," (append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.global.cattle.systemProjectId) }}
{{- else if and (ne (len .Values.global.cattle.systemProjectId) 0) (ne (len .Values.helmProjectOperator.projectReleaseNamespaces.labelValue) 0) (ne .Values.helmProjectOperator.projectReleaseNamespaces.labelValue .Values.global.cattle.systemProjectId) }}
- --system-project-label-values={{ join "," (append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.global.cattle.systemProjectId) }}
{{- else if len .Values.helmProjectOperator.otherSystemProjectLabelValues }}
- --system-project-label-values={{ join "," .Values.helmProjectOperator.otherSystemProjectLabelValues }}
{{- end }}
{{- if .Values.helmProjectOperator.projectReleaseNamespaces.enabled }}
{{- if .Values.helmProjectOperator.projectReleaseNamespaces.labelValue }}
- --project-release-label-value={{ .Values.helmProjectOperator.projectReleaseNamespaces.labelValue }}
{{- else if .Values.helmProjectOperator.global.cattle.systemProjectId }}
- --project-release-label-value={{ .Values.helmProjectOperator.global.cattle.systemProjectId }}
{{- else if .Values.global.cattle.systemProjectId }}
- --project-release-label-value={{ .Values.global.cattle.systemProjectId }}
{{- end }}
{{- end }}
{{- if .Values.helmProjectOperator.global.cattle.clusterId }}
- --cluster-id={{ .Values.helmProjectOperator.global.cattle.clusterId }}
{{- if .Values.global.cattle.clusterId }}
- --cluster-id={{ .Values.global.cattle.clusterId }}
{{- end }}
{{- if .Values.helmProjectOperator.releaseRoleBindings.aggregate }}
{{- if .Values.helmProjectOperator.releaseRoleBindings.clusterRoleRefs }}
Expand Down
4 changes: 2 additions & 2 deletions charts/prometheus-federator/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ metadata:
namespace: {{ template "prometheus-federator.namespace" . }}
labels: {{ include "prometheus-federator.labels" . | indent 4 }}
app: {{ template "prometheus-federator.name" . }}
{{- if .Values.helmProjectOperator.global.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.helmProjectOperator.global.imagePullSecrets | nindent 2 }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 2 }}
{{- end }}
# ---
# NOTE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ data:
{{- if .Values.helmProjectOperator.projectReleaseNamespaces.enabled }}
{{- if .Values.helmProjectOperator.projectReleaseNamespaces.labelValue }}
"projectReleaseLabelValue": {{ .Values.helmProjectOperator.projectReleaseNamespaces.labelValue | quote }},
{{- else if .Values.helmProjectOperator.global.cattle.systemProjectId }}
"projectReleaseLabelValue": {{ .Values.helmProjectOperator.global.cattle.systemProjectId | quote }},
{{- else if .Values.global.cattle.systemProjectId }}
"projectReleaseLabelValue": {{ .Values.global.cattle.systemProjectId | quote }},
{{- else }}
"projectReleaseLabelValue": "",
{{- end }}
{{- else }}
"projectReleaseLabelValue": "",
{{- end }}
{{- if not .Values.helmProjectOperator.projectReleaseNamespaces.enabled }}
"systemProjectLabelValues": {{ append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.helmProjectOperator.global.cattle.systemProjectId | toJson }}
{{- else if and (ne (len .Values.helmProjectOperator.global.cattle.systemProjectId) 0) (ne (len .Values.helmProjectOperator.projectReleaseNamespaces.labelValue) 0) (ne .Values.helmProjectOperator.projectReleaseNamespaces.labelValue .Values.helmProjectOperator.global.cattle.systemProjectId) }}
"systemProjectLabelValues": {{ append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.helmProjectOperator.global.cattle.systemProjectId | toJson }}
"systemProjectLabelValues": {{ append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.global.cattle.systemProjectId | toJson }}
{{- else if and (ne (len .Values.global.cattle.systemProjectId) 0) (ne (len .Values.helmProjectOperator.projectReleaseNamespaces.labelValue) 0) (ne .Values.helmProjectOperator.projectReleaseNamespaces.labelValue .Values.global.cattle.systemProjectId) }}
"systemProjectLabelValues": {{ append .Values.helmProjectOperator.otherSystemProjectLabelValues .Values.global.cattle.systemProjectId | toJson }}
{{- else if len .Values.helmProjectOperator.otherSystemProjectLabelValues }}
"systemProjectLabelValues": {{ .Values.helmProjectOperator.otherSystemProjectLabelValues | toJson }}
{{- else }}
Expand Down

0 comments on commit 008ee48

Please sign in to comment.