diff --git a/helm-charts/yunikorn/templates/admission-controller-deployment.yaml b/helm-charts/yunikorn/templates/admission-controller-deployment.yaml index 6e08cce..90c43da 100644 --- a/helm-charts/yunikorn/templates/admission-controller-deployment.yaml +++ b/helm-charts/yunikorn/templates/admission-controller-deployment.yaml @@ -92,11 +92,19 @@ spec: - name: admission-controller-secrets mountPath: /run/secrets/webhook readOnly: true + {{- if .Values.enableGoCoverDir }} + - name: go-cover-dir + mountPath: /go-cover-dir/ + {{- end }} env: - name: NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace + {{- if .Values.enableGoCoverDir }} + - name: GOCOVERDIR + value: /go-cover-dir + {{- end }} ports: - containerPort: 9089 name: webhook-api @@ -118,4 +126,10 @@ spec: - name: admission-controller-secrets secret: secretName: admission-controller-secrets + {{- if .Values.enableGoCoverDir }} + - name: go-cover-dir + hostPath: + path: /go-cover-dir/ + type: DirectoryOrCreate + {{- end }} {{ end }} diff --git a/helm-charts/yunikorn/templates/deployment.yaml b/helm-charts/yunikorn/templates/deployment.yaml index 399ba12..e367809 100644 --- a/helm-charts/yunikorn/templates/deployment.yaml +++ b/helm-charts/yunikorn/templates/deployment.yaml @@ -93,6 +93,13 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + {{- if .Values.enableGoCoverDir }} + - name: GOCOVERDIR + value: /go-cover-dir + volumeMounts: + - name: go-cover-dir + mountPath: /go-cover-dir/ + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} - name: yunikorn-scheduler-web @@ -104,3 +111,10 @@ spec: protocol: TCP resources: {{- toYaml .Values.web.resources | nindent 12 }} + {{- if .Values.enableGoCoverDir }} + volumes: + - name: go-cover-dir + hostPath: + path: /go-cover-dir/ + type: DirectoryOrCreate + {{- end }} diff --git a/helm-charts/yunikorn/values.yaml b/helm-charts/yunikorn/values.yaml index 3b6f149..e23fff4 100644 --- a/helm-charts/yunikorn/values.yaml +++ b/helm-charts/yunikorn/values.yaml @@ -124,3 +124,5 @@ enableSchedulerPlugin: false podLabels: {} podAnnotations: {} + +enableGoCoverDir: false