{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- $replicaCount := int .Values.controller.replicaCount }}
{{- if and (include "kafka.controller.createSecretConfig" .) (gt $replicaCount 0) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ printf "%s-secret-configuration" (include "kafka.controller.fullname" .) }}
  namespace: {{ include "common.names.namespace" . | quote }}
  labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
    app.kubernetes.io/component: controller-eligible
    app.kubernetes.io/part-of: kafka
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
type: Opaque
data: 
  server-secret.properties: {{ include "kafka.controller.secretConfig" . | b64enc }}
{{- end }}
  
