Skip to content

Commit 22c6f4e

Browse files
migruiz4Bitnami Containers
and
Bitnami Containers
authored
[bitnami/harbor] Revert merge chart generated env vart secret with existing secret (#32382)
* Revert "[bitnami/harbor] fix: secret envvars and their documentation (#28989)" Signed-off-by: Miguel Ruiz <[email protected]> * Add conditional Signed-off-by: Miguel Ruiz <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <[email protected]> * Restore values.yaml Signed-off-by: Miguel Ruiz <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <[email protected]> --------- Signed-off-by: Miguel Ruiz <[email protected]> Signed-off-by: Bitnami Containers <[email protected]> Co-authored-by: Bitnami Containers <[email protected]>
1 parent 6c5362b commit 22c6f4e

File tree

6 files changed

+36
-125
lines changed

6 files changed

+36
-125
lines changed

bitnami/harbor/CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3-
## 24.3.4 (2025-03-08)
3+
## 24.4.0 (2025-03-13)
44

5-
* [bitnami/harbor] removed /etc/core/token mount since it's unused ([#32364](https://github.com/bitnami/charts/pull/32364))
5+
* [bitnami/harbor] Revert merge chart generated env vart secret with existing secret ([#32382](https://github.com/bitnami/charts/pull/32382))
6+
7+
## <small>24.3.4 (2025-03-10)</small>
8+
9+
* [bitnami/harbor] removed /etc/core/token mount since it's unused (#32364) ([a4ba8ad](https://github.com/bitnami/charts/commit/a4ba8ad7c4ba8a62dc9f945fa48d07f29565b4ad)), closes [#32364](https://github.com/bitnami/charts/issues/32364)
610

711
## <small>24.3.3 (2025-02-20)</small>
812

bitnami/harbor/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ maintainers:
5656
name: harbor
5757
sources:
5858
- https://github.com/bitnami/charts/tree/main/bitnami/harbor
59-
version: 24.3.4
59+
version: 24.4.0

bitnami/harbor/templates/core/core-secret-envvars.yaml

+7-38
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,7 @@ Copyright Broadcom, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- $secretName := .Values.core.existingEnvVarsSecret -}}
7-
{{- $namespace := .Release.Namespace -}}
8-
{{- $secret := lookup "v1" "Secret" $namespace $secretName -}}
9-
{{- $existingEnvVarsSecretCore := dict -}}
10-
{{- if $secret.data }}
11-
{{- $_REDIS_URL_CORE := index $secret.data "_REDIS_URL_CORE" | default "" -}}
12-
{{- $_REDIS_URL_REG := index $secret.data "_REDIS_URL_REG" | default "" -}}
13-
{{- $_CSRF_KEY := index $secret.data "CSRF_KEY" | default "" -}}
14-
{{- $_HARBOR_ADMIN_PASSWORD := index $secret.data "HARBOR_ADMIN_PASSWORD" | default "" -}}
15-
{{- $_POSTGRESQL_PASSWORD := index $secret.data "POSTGRESQL_PASSWORD" | default "" -}}
16-
{{- $_REGISTRY_CREDENTIAL_PASSWORD := index $secret.data "REGISTRY_CREDENTIAL_PASSWORD" | default "" -}}
17-
{{- $_REGISTRY_CREDENTIAL_USERNAME := index $secret.data "REGISTRY_CREDENTIAL_USERNAME" | default "" -}}
18-
{{- $existingEnvVarsSecretCore = dict
19-
"_REDIS_URL_CORE" ($_REDIS_URL_CORE | b64dec)
20-
"_REDIS_URL_REG" ($_REDIS_URL_REG | b64dec)
21-
"CSRF_KEY" ($_CSRF_KEY | b64dec)
22-
"HARBOR_ADMIN_PASSWORD" ($_HARBOR_ADMIN_PASSWORD | b64dec)
23-
"POSTGRESQL_PASSWORD" ($_POSTGRESQL_PASSWORD | b64dec)
24-
"REGISTRY_CREDENTIAL_PASSWORD" ($_REGISTRY_CREDENTIAL_PASSWORD | b64dec)
25-
"REGISTRY_CREDENTIAL_USERNAME" ($_REGISTRY_CREDENTIAL_USERNAME | b64dec)
26-
-}}
27-
{{- end }}
28-
6+
{{- if not .Values.core.existingEnvVarsSecret }}
297
apiVersion: v1
308
kind: Secret
319
metadata:
@@ -40,20 +18,11 @@ metadata:
4018
{{- end }}
4119
type: Opaque
4220
data:
43-
_REDIS_URL_CORE: {{ $existingEnvVarsSecretCore._REDIS_URL_CORE | default (include "harbor.redisForCore" .) | b64enc | quote }}
44-
_REDIS_URL_REG: {{ $existingEnvVarsSecretCore._REDIS_URL_REG | default (include "harbor.redisForGC" .) | b64enc | quote }}
45-
REGISTRY_CREDENTIAL_USERNAME: {{ $existingEnvVarsSecretCore.REGISTRY_CREDENTIAL_USERNAME | default .Values.registry.credentials.username | b64enc | quote }}
46-
REGISTRY_CREDENTIAL_PASSWORD: {{ $existingEnvVarsSecretCore.REGISTRY_CREDENTIAL_PASSWORD | default .Values.registry.credentials.password | b64enc | quote }}
47-
POSTGRESQL_PASSWORD: {{ $existingEnvVarsSecretCore.POSTGRESQL_PASSWORD | default (include "harbor.database.rawPassword" .) | b64enc | quote }}
48-
{{- $existingCSRFKey := $existingEnvVarsSecretCore.CSRF_KEY | default "" -}}
49-
{{- if eq $existingCSRFKey "" }}
21+
_REDIS_URL_CORE: {{ include "harbor.redisForCore" . | b64enc | quote }}
22+
_REDIS_URL_REG: {{ include "harbor.redisForGC" . | b64enc | quote }}
23+
REGISTRY_CREDENTIAL_USERNAME: {{ .Values.registry.credentials.username | b64enc | quote }}
24+
REGISTRY_CREDENTIAL_PASSWORD: {{ .Values.registry.credentials.password | b64enc | quote }}
5025
CSRF_KEY: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s-envvars" (include "harbor.core" .)) "key" "CSRF_KEY" "length" 32 "providedValues" (list "core.csrfKey") "context" $) }}
51-
{{- else }}
52-
CSRF_KEY: {{ $existingCSRFKey | b64enc | quote }}
53-
{{- end }}
54-
{{- $existingHarborAdmPW := $existingEnvVarsSecretCore.HARBOR_ADMIN_PASSWORD | default "" -}}
55-
{{- if eq $existingHarborAdmPW "" }}
5626
HARBOR_ADMIN_PASSWORD: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s-envvars" (include "harbor.core" .)) "key" "HARBOR_ADMIN_PASSWORD" "length" 22 "providedValues" (list "adminPassword") "context" $) }}
57-
{{- else }}
58-
HARBOR_ADMIN_PASSWORD: {{ $existingHarborAdmPW | b64enc | quote }}
59-
{{- end }}
27+
POSTGRESQL_PASSWORD: {{ include "harbor.database.rawPassword" . | b64enc | quote }}
28+
{{- end }}

bitnami/harbor/templates/jobservice/jobservice-secret-envvars.yaml

+4-15
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@ Copyright Broadcom, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- $secretName := .Values.jobservice.existingEnvVarsSecret -}}
7-
{{- $namespace := .Release.Namespace -}}
8-
{{- $secret := lookup "v1" "Secret" $namespace $secretName -}}
9-
{{- $existingEnvVarsSecretJobservice := dict -}}
10-
{{- if $secret.data }}
11-
{{- $_REGISTRY_CREDENTIAL_PASSWORD := index $secret.data "REGISTRY_CREDENTIAL_PASSWORD" | default "" -}}
12-
{{- $_JOB_SERVICE_POOL_REDIS_URL := index $secret.data "JOB_SERVICE_POOL_REDIS_URL" | default "" -}}
13-
{{- $existingEnvVarsSecretJobservice = dict
14-
"REGISTRY_CREDENTIAL_PASSWORD" ($_REGISTRY_CREDENTIAL_PASSWORD | b64dec)
15-
"JOB_SERVICE_POOL_REDIS_URL" ($_JOB_SERVICE_POOL_REDIS_URL | b64dec)
16-
-}}
17-
{{- end }}
18-
6+
{{- if not .Values.jobservice.existingEnvVarsSecret }}
197
apiVersion: v1
208
kind: Secret
219
metadata:
@@ -30,5 +18,6 @@ metadata:
3018
{{- end }}
3119
type: Opaque
3220
data:
33-
REGISTRY_CREDENTIAL_PASSWORD: {{ $existingEnvVarsSecretJobservice.REGISTRY_CREDENTIAL_PASSWORD | default .Values.registry.credentials.password | b64enc | quote }}
34-
JOB_SERVICE_POOL_REDIS_URL: {{ $existingEnvVarsSecretJobservice.JOB_SERVICE_POOL_REDIS_URL | default (include "harbor.redisForJobservice" .) | b64enc | quote }}
21+
REGISTRY_CREDENTIAL_PASSWORD: {{ .Values.registry.credentials.password | b64enc | quote }}
22+
JOB_SERVICE_POOL_REDIS_URL: {{ include "harbor.redisForJobservice" . | b64enc | quote }}
23+
{{- end }}

bitnami/harbor/templates/registry/registry-secret.yaml

+13-47
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,7 @@ Copyright Broadcom, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- $secretName := .Values.registry.existingSecret -}}
7-
{{- $namespace := .Release.Namespace -}}
8-
{{- $secret := lookup "v1" "Secret" $namespace $secretName -}}
9-
{{- $existingEnvVarsSecretRegistry := dict -}}
10-
{{- if $secret.data }}
11-
{{- $_REGISTRY_HTPASSWD := index $secret.data "REGISTRY_HTPASSWD" | default "" -}}
12-
{{- $_REGISTRY_HTTP_SECRET := index $secret.data "REGISTRY_HTTP_SECRET" | default "" -}}
13-
{{- $_REGISTRY_REDIS_PASSWORD := index $secret.data "REGISTRY_REDIS_PASSWORD" | default "" -}}
14-
{{- $_REGISTRY_STORAGE_AZURE_ACCOUNTKEY := index $secret.data "REGISTRY_STORAGE_AZURE_ACCOUNTKEY" | default "" -}}
15-
{{- $_GCS_KEY_DATA := index $secret.data "GCS_KEY_DATA" | default "" -}}
16-
{{- $_REGISTRY_STORAGE_S3_ACCESSKEY := index $secret.data "REGISTRY_STORAGE_S3_ACCESSKEY" | default "" -}}
17-
{{- $_REGISTRY_STORAGE_S3_SECRETKEY := index $secret.data "REGISTRY_STORAGE_S3_SECRETKEY" | default "" -}}
18-
{{- $_REGISTRY_STORAGE_SWIFT_PASSWORD := index $secret.data "REGISTRY_STORAGE_SWIFT_PASSWORD" | default "" -}}
19-
{{- $_REGISTRY_STORAGE_SWIFT_SECRETKEY := index $secret.data "REGISTRY_STORAGE_SWIFT_SECRETKEY" | default "" -}}
20-
{{- $_REGISTRY_STORAGE_SWIFT_ACCESSKEY := index $secret.data "REGISTRY_STORAGE_SWIFT_ACCESSKEY" | default "" -}}
21-
{{- $_REGISTRY_STORAGE_OSS_ACCESSKEYSECRET := index $secret.data "REGISTRY_STORAGE_OSS_ACCESSKEYSECRET" | default "" -}}
22-
{{- $existingEnvVarsSecretRegistry = dict
23-
"REGISTRY_HTPASSWD" ($_REGISTRY_HTPASSWD | b64dec)
24-
"REGISTRY_HTTP_SECRET" ($_REGISTRY_HTTP_SECRET | b64dec)
25-
"REGISTRY_REDIS_PASSWORD" ($_REGISTRY_REDIS_PASSWORD | b64dec)
26-
"REGISTRY_STORAGE_AZURE_ACCOUNTKEY" ($_REGISTRY_STORAGE_AZURE_ACCOUNTKEY | b64dec)
27-
"GCS_KEY_DATA" ($_GCS_KEY_DATA | b64dec)
28-
"REGISTRY_STORAGE_S3_ACCESSKEY" ($_REGISTRY_STORAGE_S3_ACCESSKEY | b64dec)
29-
"REGISTRY_STORAGE_S3_SECRETKEY" ($_REGISTRY_STORAGE_S3_SECRETKEY | b64dec)
30-
"REGISTRY_STORAGE_SWIFT_PASSWORD" ($_REGISTRY_STORAGE_SWIFT_PASSWORD | b64dec)
31-
"REGISTRY_STORAGE_SWIFT_SECRETKEY" ($_REGISTRY_STORAGE_SWIFT_SECRETKEY | b64dec)
32-
"REGISTRY_STORAGE_SWIFT_ACCESSKEY" ($_REGISTRY_STORAGE_SWIFT_ACCESSKEY | b64dec)
33-
"REGISTRY_STORAGE_OSS_ACCESSKEYSECRET" ($_REGISTRY_STORAGE_OSS_ACCESSKEYSECRET | b64dec)
34-
-}}
35-
{{- end }}
36-
6+
{{- if not .Values.registry.existingSecret }}
377
apiVersion: v1
388
kind: Secret
399
metadata:
@@ -47,35 +17,31 @@ metadata:
4717
{{- end }}
4818
type: Opaque
4919
data:
50-
REGISTRY_HTPASSWD: {{ $existingEnvVarsSecretRegistry.REGISTRY_HTPASSWD | default .Values.registry.credentials.htpasswd | b64enc | quote }}
51-
{{- $registryHttpSecret := $existingEnvVarsSecretRegistry.REGISTRY_HTTP_SECRET | default "" -}}
52-
{{- if eq $registryHttpSecret "" }}
53-
REGISTRY_HTTP_SECRET: {{ include "common.secrets.passwords.manage" ( dict "secret" (include "harbor.registry" .) "key" "REGISTRY_HTTP_SECRET" "length" 16 "providedValues" (list "registry.secret") "context" $ ) }}
54-
{{- else }}
55-
REGISTRY_HTTP_SECRET: {{ print $registryHttpSecret | b64enc | quote }}
56-
{{- end }}
57-
REGISTRY_REDIS_PASSWORD: {{ $existingEnvVarsSecretRegistry.REGISTRY_REDIS_PASSWORD | default (include "harbor.redis.rawPassword" .) | b64enc | quote }}
20+
REGISTRY_HTPASSWD: {{ .Values.registry.credentials.htpasswd | b64enc | quote }}
21+
REGISTRY_HTTP_SECRET: {{ include "common.secrets.passwords.manage" (dict "secret" (include "harbor.registry" .) "key" "REGISTRY_HTTP_SECRET" "length" 16 "providedValues" (list "registry.secret") "context" $) }}
22+
REGISTRY_REDIS_PASSWORD: {{ (include "harbor.redis.rawPassword" .) | b64enc | quote }}
5823
{{- if eq .Values.persistence.imageChartStorage.type "azure" }}
59-
REGISTRY_STORAGE_AZURE_ACCOUNTKEY: {{ $existingEnvVarsSecretRegistry.REGISTRY_STORAGE_AZURE_ACCOUNTKEY | default .Values.persistence.imageChartStorage.azure.accountkey | b64enc | quote }}
24+
REGISTRY_STORAGE_AZURE_ACCOUNTKEY: {{ .Values.persistence.imageChartStorage.azure.accountkey | b64enc | quote }}
6025
{{- else if eq .Values.persistence.imageChartStorage.type "gcs" }}
6126
{{- if .Values.persistence.imageChartStorage.gcs.encodedkey }}
62-
GCS_KEY_DATA: {{ $existingEnvVarsSecretRegistry.GCS_KEY_DATA | default .Values.persistence.imageChartStorage.gcs.encodedkey | quote }}
27+
GCS_KEY_DATA: {{ .Values.persistence.imageChartStorage.gcs.encodedkey | quote }}
6328
{{- end }}
6429
{{- else if eq .Values.persistence.imageChartStorage.type "s3" }}
6530
{{- if .Values.persistence.imageChartStorage.s3.accesskey }}
66-
REGISTRY_STORAGE_S3_ACCESSKEY: {{ $existingEnvVarsSecretRegistry.REGISTRY_STORAGE_S3_ACCESSKEY | default .Values.persistence.imageChartStorage.s3.accesskey | b64enc | quote }}
31+
REGISTRY_STORAGE_S3_ACCESSKEY: {{ .Values.persistence.imageChartStorage.s3.accesskey | b64enc | quote }}
6732
{{- end }}
6833
{{- if .Values.persistence.imageChartStorage.s3.secretkey }}
69-
REGISTRY_STORAGE_S3_SECRETKEY: {{ $existingEnvVarsSecretRegistry.REGISTRY_STORAGE_S3_SECRETKEY | default .Values.persistence.imageChartStorage.s3.secretkey | b64enc | quote }}
34+
REGISTRY_STORAGE_S3_SECRETKEY: {{ .Values.persistence.imageChartStorage.s3.secretkey | b64enc | quote }}
7035
{{- end }}
7136
{{- else if eq .Values.persistence.imageChartStorage.type "swift" }}
72-
REGISTRY_STORAGE_SWIFT_PASSWORD: {{ $existingEnvVarsSecretRegistry.REGISTRY_STORAGE_SWIFT_PASSWORD | default .Values.persistence.imageChartStorage.swift.password | b64enc | quote }}
37+
REGISTRY_STORAGE_SWIFT_PASSWORD: {{ .Values.persistence.imageChartStorage.swift.password | b64enc | quote }}
7338
{{- if .Values.persistence.imageChartStorage.swift.secretkey }}
74-
REGISTRY_STORAGE_SWIFT_SECRETKEY: {{ $existingEnvVarsSecretRegistry.REGISTRY_STORAGE_SWIFT_SECRETKEY | default .Values.persistence.imageChartStorage.swift.secretkey | b64enc | quote }}
39+
REGISTRY_STORAGE_SWIFT_SECRETKEY: {{ .Values.persistence.imageChartStorage.swift.secretkey | b64enc | quote }}
7540
{{- end }}
7641
{{- if .Values.persistence.imageChartStorage.swift.accesskey }}
77-
REGISTRY_STORAGE_SWIFT_ACCESSKEY: {{ $existingEnvVarsSecretRegistry.REGISTRY_STORAGE_SWIFT_ACCESSKEY | default .Values.persistence.imageChartStorage.swift.accesskey | b64enc | quote }}
42+
REGISTRY_STORAGE_SWIFT_ACCESSKEY: {{ .Values.persistence.imageChartStorage.swift.accesskey | b64enc | quote }}
7843
{{- end }}
7944
{{- else if eq .Values.persistence.imageChartStorage.type "oss" }}
80-
REGISTRY_STORAGE_OSS_ACCESSKEYSECRET: {{ $existingEnvVarsSecretRegistry.REGISTRY_STORAGE_OSS_ACCESSKEYSECRET | default .Values.persistence.imageChartStorage.oss.accesskeysecret | b64enc | quote }}
45+
REGISTRY_STORAGE_OSS_ACCESSKEYSECRET: {{ .Values.persistence.imageChartStorage.oss.accesskeysecret | b64enc | quote }}
8146
{{- end }}
47+
{{- end }}

bitnami/harbor/templates/trivy/trivy-secret-envvars.yaml

+5-22
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,7 @@ Copyright Broadcom, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- $secretName := .Values.trivy.existingEnvVarsSecret -}}
7-
{{- $namespace := .Release.Namespace -}}
8-
{{- $secret := lookup "v1" "Secret" $namespace $secretName -}}
9-
{{- $existingEnvVarsSecretTrivy := dict -}}
10-
{{- if $secret.data }}
11-
{{- $_SCANNER_TRIVY_GITHUB_TOKEN := index $secret.data "SCANNER_TRIVY_GITHUB_TOKEN" | default "" -}}
12-
{{- $_SCANNER_REDIS_URL := index $secret.data "SCANNER_REDIS_URL" | default "" -}}
13-
{{- $_SCANNER_STORE_REDIS_URL := index $secret.data "SCANNER_STORE_REDIS_URL" | default "" -}}
14-
{{- $_SCANNER_JOB_QUEUE_REDIS_URL := index $secret.data "SCANNER_JOB_QUEUE_REDIS_URL" | default "" -}}
15-
{{- $existingEnvVarsSecretTrivy = dict
16-
"SCANNER_TRIVY_GITHUB_TOKEN" ($_SCANNER_TRIVY_GITHUB_TOKEN | b64dec)
17-
"SCANNER_REDIS_URL" ($_SCANNER_REDIS_URL | b64dec)
18-
"SCANNER_STORE_REDIS_URL" ($_SCANNER_STORE_REDIS_URL | b64dec)
19-
"SCANNER_JOB_QUEUE_REDIS_URL" ($_SCANNER_JOB_QUEUE_REDIS_URL | b64dec)
20-
-}}
21-
{{- end }}
22-
23-
{{- if and .Values.trivy.enabled }}
6+
{{- if and .Values.trivy.enabled (not .Values.trivy.existingEnvVarsSecret) }}
247
apiVersion: v1
258
kind: Secret
269
metadata:
@@ -35,8 +18,8 @@ metadata:
3518
{{- end }}
3619
type: Opaque
3720
data:
38-
SCANNER_TRIVY_GITHUB_TOKEN: {{ $existingEnvVarsSecretTrivy.SCANNER_TRIVY_GITHUB_TOKEN | default (.Values.trivy.gitHubToken | default "") | b64enc | quote }}
39-
SCANNER_REDIS_URL: {{ $existingEnvVarsSecretTrivy.SCANNER_REDIS_URL | default (include "harbor.redisForTrivyAdapter" .) | b64enc }}
40-
SCANNER_STORE_REDIS_URL: {{ $existingEnvVarsSecretTrivy.SCANNER_STORE_REDIS_URL | default (include "harbor.redisForTrivyAdapter" .) | b64enc }}
41-
SCANNER_JOB_QUEUE_REDIS_URL: {{ $existingEnvVarsSecretTrivy.SCANNER_JOB_QUEUE_REDIS_URL | default (include "harbor.redisForTrivyAdapter" .) | b64enc }}
21+
SCANNER_TRIVY_GITHUB_TOKEN: {{ .Values.trivy.gitHubToken | default "" | b64enc | quote }}
22+
SCANNER_REDIS_URL: {{ include "harbor.redisForTrivyAdapter" . | b64enc }}
23+
SCANNER_STORE_REDIS_URL: {{ include "harbor.redisForTrivyAdapter" . | b64enc }}
24+
SCANNER_JOB_QUEUE_REDIS_URL: {{ include "harbor.redisForTrivyAdapter" . | b64enc }}
4225
{{- end }}

0 commit comments

Comments
 (0)