File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,34 @@ umask 0177
6666INJECTSUB=" $SECRETS " INJECTSUBKWD=" auth" RMVCOMMENT=1 extract_yaml clouds.$OS_CLOUD < $CLOUDS_YAML | sed " s/^\\ (\\ s*\\ )\\ ($OS_CLOUD \\ ):/\\ 1openstack:/" > ~ /tmp/clouds-$OS_CLOUD .yaml
6767sed -i ' s@^\(\s*cacert:\).*@\1 /etc/openstack/cacert.pem@' ~ /tmp/clouds-$OS_CLOUD .yaml
6868CL_YAML=$( ls ~ /tmp/clouds-$OS_CLOUD .yaml)
69- kubectl create secret -n kube-system generic clouds-yaml --from-file=$CL_YAML --dry-run=client -oyaml > ~ /tmp/clouds-$OS_CLOUD -yaml-secret
69+ CL_YAML_B64=$( base64 -w0 < " $CL_YAML " )
70+ # kubectl create secret -n $CS_NAMESPACE generic clouds-yaml --from-file=$CL_YAML
7071umask $OLD_UMASK
7172if test -n " $OS_CACERT " ; then
7273 OS_CACERT=${OS_CACERT/ \~ / $HOME }
73- kubectl create secret -n kube-system generic cacert-pem --from-file=$OS_CACERT --dry-run=client -oyaml > ~ /tmp/cacert-secret
74+ CACERT_B64=$( base64 -w0 < $OS_CACERT )
75+ cat | kubectl apply -f - << EOT
76+ apiVersion: v1
77+ data:
78+ clouds.yaml: $CL_YAML_B64
79+ cacert.pem: $CACERT_B64
80+ kind: Secret
81+ metadata:
82+ name: openstack
83+ namespace: $CS_NAMESPACCE
84+ type: Opaque
85+ EOT
86+ else
87+ cat | kubectl apply -f << EOT
88+ apiVersion: v1
89+ data:
90+ clouds.yaml: $CL_YAML_B64
91+ kind: Secret
92+ metadata:
93+ name: openstack
94+ namespace: $CS_NAMESPACCE
95+ type: Opaque
96+ EOT
7497fi
7598# FIXME: We will provide more settings in cluster-settings.env later, hardcode it for now
7699# if test "$CS_CCMLB=octavia-ovn"; then OCTOVN="--set octavia_ovn=true"; else unset OCTOVN; fi
You can’t perform that action at this time.
0 commit comments