################################################################################
# Copyright (c) 2019 AT&T Intellectual Property. #
-# Copyright (c) 2019 Nokia. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
################################################################################
+{{ $auxNameSpace := include "common.namespace.aux" . }}
+{{ $infraNameSpace := include "common.namespace.infra" . }}
+{{ $nameSpaceList := list $auxNameSpace $infraNameSpace }}
+{{- range $nameSpaceList }}
+{{- $namespace := . }}
+{{- range keys $.Values.credential }}
+{{- with index $.Values.credential . }}
+{{- $repo := .registry }}
+{{- $cred := .credential }}
+{{- $user := default "docker" $cred.user }}
+{{- $password := default "docker" $cred.password }}
+{{- $mail := default "@" $cred.mail }}
+{{- $auth := printf "%s:%s" $user $password | b64enc }}
+---
apiVersion: v1
kind: Secret
metadata:
- name: docker-reg-cred
+ name: secret-{{ $repo | replace "." "-" | replace ":" "-" | replace "/" "-" }}
+ namespace: {{ $namespace }}
data:
- .dockercfg: {{ include "repository.secret" . }}
+ .dockercfg: {{ printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $user $password $mail $auth | b64enc }}
type: kubernetes.io/dockercfg
+{{- end }}
+{{- end }}
+{{- end }}