Add standalone R3 RIC platform helm charts and deployment scripts.
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / docker-credential / templates / secrets-docker-reg.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
10 #   Unless required by applicable law or agreed to in writing, software        #
11 #   distributed under the License is distributed on an "AS IS" BASIS,          #
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13 #   See the License for the specific language governing permissions and        #
14 #   limitations under the License.                                             #
15 ################################################################################
16 {{ $platformNameSpace := include "common.namespace.platform" . }}
17 {{ $xAppNameSpace := include "common.namespace.xapp" . }}
18 {{ $infraNameSpace := include "common.namespace.infra" . }}
19 {{ $nameSpaceList := list $platformNameSpace $xAppNameSpace $infraNameSpace }}
20 {{- range $nameSpaceList }}
21 {{- $namespace := . }}
22 {{- range keys $.Values.credential }}
23 {{- with index $.Values.credential . }}
24 {{- $repo := .registry }}
25 {{- $cred := .credential }}
26 {{- $user := default "docker" $cred.user }}
27 {{- $password := default "docker" $cred.password }}
28 {{- $mail := default "@" $cred.mail }}
29 {{- $auth := printf "%s:%s" $user $password | b64enc }}
30 ---
31 apiVersion: v1
32 kind: Secret
33 metadata:
34   name: secret-{{ $repo | replace "." "-" | replace ":" "-" | replace "/" "-" }}
35   namespace: {{ $namespace }}
36 data:
37   .dockercfg: {{ printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $user $password $mail $auth | b64enc }}
38 type: kubernetes.io/dockercfg
39 {{- end }}
40 {{- end }}
41 {{- end }}