{{- if .Values.config.enabled | default .Values.global.config.enabled -}}
apiVersion: v1
kind: Secret
metadata:
  name: vsphere-cpi
  labels:
    app: {{ template "cpi.name" . }}
    vsphere-cpi-infra: secret
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    component: cloud-controller-manager
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  namespace: {{ .Release.Namespace }}
stringData:
  {{ .Values.config.vcenter | default .Values.global.config.vcenter }}.username: {{ .Values.config.username | default .Values.global.config.username }}
  {{ .Values.config.vcenter | default .Values.global.config.vcenter }}.password: {{ .Values.config.password | default .Values.global.config.password }}
{{- end -}}
