apiVersion: v2.edp.epam.com/v1
kind: Jenkins
metadata:
  name: jenkins
  annotations:
    edp.epam.com/admin-token: jenkins-admin-token
  labels:
  {{- include "jenkins-operator.metaLabels" . | nindent 4 }}
spec:
  edpSpec:
    dnsWildcard: {{ .Values.dnsWildcard }}
  {{- if .Values.jenkins.basePath }}
  basePath: "{{ .Values.jenkins.basePath }}"
  {{- end }}
  sharedLibraries:
    {{- range $key, $value := .Values.jenkins.sharedLibraries }}
    - name: {{ $key }}
      url: {{ $value.url }}
      tag: {{ $value.tag }}
      {{- if $value.secret }}
      secret: {{ $value.secret }}
      type: {{ $value.type }}
  {{- end }}
  {{- end }}
  keycloakSpec:
    enabled: {{ .Values.keycloakIntegration.enabled }}
    realm: {{ template "keycloak.realm" . }}
