** Please be patient while the chart is being deployed **

1. Get the Harbor URL:

{{- if .Values.ingress.enabled }}

  You should be able to access your new Harbor installation through {{ include "harbor.externalUrl" . }}

{{- else if contains "LoadBalancer" .Values.service.type }}

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "common.names.fullname" . }}'

{{- $port:=.Values.service.ports.http | toString }}
  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
  echo "Harbor URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.ports.http  }}{{ end }}/"

{{- else if contains "ClusterIP" .Values.service.type }}

  {{- if .Values.service.tls.enabled }}

  echo "Harbor URL: https://127.0.0.1:8443/"
  kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }} 8443:{{ .Values.service.ports.https }}

  {{- else }}

  echo "Harbor URL: http://127.0.0.1:8080/"
  kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }} 8080:{{ .Values.service.ports.http }}

  {{- end }}

{{- else if contains "NodePort" .Values.service.type }}

  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo "Harbor URL: http://$NODE_IP:$NODE_PORT/"

{{- end }}

2. Login with the following credentials to see your Harbor application

  echo Username: "admin"
  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" . }}
