Skip to content

Commit 5a956f4

Browse files
authored
Merge pull request #4808 from fhirscher/helm-plugin-crd-with-conversion-webhook
🐛 (helm/v1-alpha): Append project name to webhook service name
2 parents 9c3de19 + 5e91ffe commit 5a956f4

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

docs/book/src/multiversion-tutorial/testdata/project/dist/chart/templates/crd/batch.tutorial.kubebuilder.io_cronjobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
clientConfig:
2323
service:
2424
namespace: {{ .Release.Namespace }}
25-
name: webhook-service
25+
name: project-webhook-service
2626
path: /convert
2727
conversionReviewVersions:
2828
- v1

pkg/plugins/optional/helm/v1alpha/scaffolds/init.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ func copyFileWithHelmLogic(srcFile, destFile, subDir, projectName string, hasCon
424424
labels:
425425
{{- include "chart.labels" . | nindent 4 }}`, 1)
426426

427+
// Append project name to webhook service name
428+
contentStr = strings.ReplaceAll(contentStr, "name: webhook-service", "name: "+projectName+"-webhook-service")
429+
427430
var wrappedContent string
428431
if isMetricRBACFile(subDir, srcFile) {
429432
wrappedContent = fmt.Sprintf(

testdata/project-v4-with-plugins/dist/chart/templates/crd/example.com.testproject.org_wordpresses.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
clientConfig:
2323
service:
2424
namespace: {{ .Release.Namespace }}
25-
name: webhook-service
25+
name: project-v4-with-plugins-webhook-service
2626
path: /convert
2727
conversionReviewVersions:
2828
- v1

0 commit comments

Comments
 (0)