Skip to content

Commit 0126096

Browse files
Zuhair AlSaderarttor
authored andcommitted
use an alias for cert-manager
Signed-off-by: Zuhair AlSader <[email protected]>
1 parent 2d1d959 commit 0126096

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

pkg/helm/chart.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ func overwriteTemplateFile(filename, chartDir string, crd bool, templates []helm
103103

104104
func overwriteValuesFile(chartDir string, values helmify.Values, certManagerAsSubchart bool) error {
105105
if certManagerAsSubchart {
106-
_, err := values.Add(true, "cert-manager", "installCRDs")
106+
_, err := values.Add(true, "certmanager", "installCRDs")
107107
if err != nil {
108108
return errors.Wrap(err, "unable to add cert-manager.installCRDs")
109109
}
110110

111-
_, err = values.Add(true, "cert-manager", "enabled")
111+
_, err = values.Add(true, "certmanager", "enabled")
112112
if err != nil {
113113
return errors.Wrap(err, "unable to add cert-manager.enabled")
114114
}

pkg/helm/init.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ version: 0.1.0
124124
appVersion: "0.1.0"
125125
`
126126

127+
const certManagerDependencies = `
128+
dependencies:
129+
- name: cert-manager
130+
repository: https://charts.jetstack.io
131+
condition: certmanager.enabled
132+
alias: certmanager
133+
`
134+
127135
var chartName = regexp.MustCompile("^[a-zA-Z0-9._-]+$")
128136

129137
const maxChartNameLength = 250
@@ -183,13 +191,8 @@ func createCommonFiles(chartDir, chartName string, crd bool, certManagerAsSubcha
183191

184192
func chartYAML(appName string, certManagerAsSubchart bool) []byte {
185193
chartFile := defaultChartfile
186-
annotatins := `
187-
dependencies:
188-
- name: cert-manager
189-
repository: https://charts.jetstack.io
190-
condition: certManager.enabled`
191194
if certManagerAsSubchart {
192-
chartFile += annotatins
195+
chartFile += certManagerDependencies
193196
}
194197
return []byte(fmt.Sprintf(chartFile, appName))
195198
}

0 commit comments

Comments
 (0)