mirror of
https://github.com/bitnami/charts.git
synced 2026-03-15 14:57:16 +08:00
Add function to check the externalURL http prefix
Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: harbor
|
||||
version: 3.0.6
|
||||
version: 3.0.7
|
||||
appVersion: 1.9.3
|
||||
description: Harbor is an an open source trusted cloud native registry project that stores, signs, and scans content
|
||||
keywords:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
{{- if contains "Ingress" .Values.service.type }}
|
||||
|
||||
You should be able to access your new Harbor installation through {{ .Values.externalURL }}
|
||||
You should be able to access your new Harbor installation through {{ include "harbor.externalUrl" . }}
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
|
||||
@@ -43,4 +43,4 @@
|
||||
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "harbor.core" . }}-envvars -o jsonpath="{.data.HARBOR_ADMIN_PASSWORD}" | base64 --decode)
|
||||
|
||||
{{ include "harbor.validateValues" . }}
|
||||
{{ include "harbor.checkRollingTags" . }}
|
||||
{{ include "harbor.checkRollingTags" . }}
|
||||
|
||||
@@ -837,9 +837,20 @@ Usage:
|
||||
{{ include "harbor.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "harbor.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- if typeIs "string" .value -}}
|
||||
{{- tpl .value .context -}}
|
||||
{{- else -}}
|
||||
{{- tpl (.value | toYaml) .context -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Set the http prefix if the externalURl dont have it
|
||||
*/}}
|
||||
{{- define "harbor.externalUrl" -}}
|
||||
{{- if hasPrefix "http" .Values.externalURL -}}
|
||||
{{- print .Values.externalURL -}}
|
||||
{{- else -}}
|
||||
{{- printf "http://%s" .Values.externalURL -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -15,7 +15,7 @@ data:
|
||||
# The user is hardcoded because the core binary has it hardcoded so it is not configurable.
|
||||
BASIC_AUTH_USER: "chart_controller"
|
||||
{{- if .Values.chartmuseum.absoluteUrl }}
|
||||
CHART_URL: "{{ .Values.externalURL }}/{{ .Values.chartmuseum.chartRepoName }}"
|
||||
CHART_URL: "{{ template "harbor.externalUrl" . }}/{{ .Values.chartmuseum.chartRepoName }}"
|
||||
{{- end }}
|
||||
DEPTH: {{ .Values.chartmuseum.depth | quote }}
|
||||
{{- if or (eq .Values.logLevel "debug") .Values.chartMuseumImage.debug }}
|
||||
|
||||
@@ -10,7 +10,7 @@ data:
|
||||
POSTGRESQL_USERNAME: "{{ .Values.postgresql.postgresqlUsername }}"
|
||||
POSTGRESQL_DATABASE: "registry"
|
||||
POSTGRESQL_SSLMODE: "{{ template "harbor.database.sslmode" . }}"
|
||||
EXT_ENDPOINT: "{{ .Values.externalURL }}"
|
||||
EXT_ENDPOINT: "{{ template "harbor.externalUrl" . }}"
|
||||
CORE_URL: "http://{{ template "harbor.core" . }}"
|
||||
JOBSERVICE_URL: "http://{{ template "harbor.fullname" . }}-jobservice"
|
||||
REGISTRY_URL: "http://{{ template "harbor.registry" . }}:5000"
|
||||
|
||||
@@ -42,7 +42,7 @@ data:
|
||||
"auth": {
|
||||
"type": "token",
|
||||
"options": {
|
||||
"realm": "{{ .Values.externalURL }}/service/token",
|
||||
"realm": "{{ template "harbor.externalUrl" . }}/service/token",
|
||||
"service": "harbor-notary",
|
||||
"issuer": "harbor-token-issuer",
|
||||
"rootcertbundle": "/root.crt"
|
||||
|
||||
@@ -150,7 +150,7 @@ data:
|
||||
auth:
|
||||
token:
|
||||
issuer: harbor-token-issuer
|
||||
realm: "{{ .Values.externalURL }}/service/token"
|
||||
realm: "{{ template "harbor.externalUrl" . }}/service/token"
|
||||
rootcertbundle: /etc/registry/root.crt
|
||||
service: harbor-registry
|
||||
validation:
|
||||
|
||||
Reference in New Issue
Block a user