Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package helmify for openSUSE:Factory checked in at 2023-03-29 23:28:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/helmify (Old) and /work/SRC/openSUSE:Factory/.helmify.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "helmify" Wed Mar 29 23:28:25 2023 rev:6 rq:1075278 version:0.3.34 Changes: -------- --- /work/SRC/openSUSE:Factory/helmify/helmify.changes 2023-03-24 15:21:44.823302766 +0100 +++ /work/SRC/openSUSE:Factory/.helmify.new.31432/helmify.changes 2023-03-29 23:28:27.415860005 +0200 @@ -1,0 +2,10 @@ +Wed Mar 29 12:28:49 UTC 2023 - ka...@b1-systems.de + +- Update to version 0.3.34: + * Use the latest version of cert-manager + * Update the multiline annotation and use helmify.Values to add + the options in the values.yaml + * Add an option cert-manager-as-subchart to install the + cert-manager as subchart + +------------------------------------------------------------------- Old: ---- helmify-0.3.33.obscpio New: ---- helmify-0.3.34.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ helmify.spec ++++++ --- /var/tmp/diff_new_pack.4Ddzzv/_old 2023-03-29 23:28:28.451865541 +0200 +++ /var/tmp/diff_new_pack.4Ddzzv/_new 2023-03-29 23:28:28.455865563 +0200 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: helmify -Version: 0.3.33 +Version: 0.3.34 Release: 0 Summary: Creates Helm chart from Kubernetes yaml License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.4Ddzzv/_old 2023-03-29 23:28:28.491865755 +0200 +++ /var/tmp/diff_new_pack.4Ddzzv/_new 2023-03-29 23:28:28.491865755 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/arttor/helmify/</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v0.3.33</param> + <param name="revision">v0.3.34</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.4Ddzzv/_old 2023-03-29 23:28:28.511865862 +0200 +++ /var/tmp/diff_new_pack.4Ddzzv/_new 2023-03-29 23:28:28.515865883 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/arttor/helmify/</param> - <param name="changesrevision">f9a41896286bb996f954e2bcf1641ec04d2d0745</param></service></servicedata> + <param name="changesrevision">2d1d959cc147a9e23bd7dbd5619315649c205ecc</param></service></servicedata> (No newline at EOF) ++++++ helmify-0.3.33.obscpio -> helmify-0.3.34.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/README.md new/helmify-0.3.34/README.md --- old/helmify-0.3.33/README.md 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/README.md 2023-03-29 11:04:12.000000000 +0200 @@ -86,7 +86,7 @@ | -version | Print helmify version. | `helmify -version`| | -crd-dir | Place crds in their own folder per Helm 3 [docs](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you). Caveat: CRDs templating is not supported by Helm. | `helmify -crd-dir`| | -image-pull-secrets| Allows the user to use existing secrets as imagePullSecrets | `helmify -image-pull-secrets`| - +| -cert-manager-as-subchart | Allows the user to install cert-manager as a subchart | `helmify -cert-manager-as-subchart`| ## Status Supported k8s resources: - Deployment, DaemonSet, StatefulSet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/cmd/helmify/flags.go new/helmify-0.3.34/cmd/helmify/flags.go --- old/helmify-0.3.33/cmd/helmify/flags.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/cmd/helmify/flags.go 2023-03-29 11:04:12.000000000 +0200 @@ -38,6 +38,7 @@ flag.BoolVar(&crd, "crd-dir", false, "Enable crd install into 'crds' directory.\nWarning: CRDs placed in 'crds' directory will not be templated by Helm.\nSee https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations\nExample: helmify -crd-dir") flag.BoolVar(&result.ImagePullSecrets, "image-pull-secrets", false, "Allows the user to use existing secrets as imagePullSecrets in values.yaml") flag.BoolVar(&result.GenerateDefaults, "generate-defaults", false, "Allows the user to add empty placeholders for tipical customization options in values.yaml. Currently covers: topology constraints, node selectors, tolerances") + flag.BoolVar(&result.CertManagerAsSubchart, "cert-manager-as-subchart", false, "Allows the user to add cert-manager as a subchart") flag.Parse() if h || help { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/pkg/app/context.go new/helmify-0.3.34/pkg/app/context.go --- old/helmify-0.3.33/pkg/app/context.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/pkg/app/context.go 2023-03-29 11:04:12.000000000 +0200 @@ -67,7 +67,7 @@ default: } } - return c.output.Create(c.config.ChartDir, c.config.ChartName, c.config.Crd, templates) + return c.output.Create(c.config.ChartDir, c.config.ChartName, c.config.Crd, c.config.CertManagerAsSubchart, templates) } func (c *appContext) process(obj *unstructured.Unstructured) (helmify.Template, error) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/pkg/config/config.go new/helmify-0.3.34/pkg/config/config.go --- old/helmify-0.3.33/pkg/config/config.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/pkg/config/config.go 2023-03-29 11:04:12.000000000 +0200 @@ -26,6 +26,8 @@ // GenerateDefaults enables the generation of empty values placeholders for common customization options of helm chart // current generated values: tolerances, node selectors, topology constraints GenerateDefaults bool + // CertManagerAsSubchart enables the generation of a subchart for cert-manager + CertManagerAsSubchart bool } func (c *Config) Validate() error { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/pkg/helm/chart.go new/helmify-0.3.34/pkg/helm/chart.go --- old/helmify-0.3.33/pkg/helm/chart.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/pkg/helm/chart.go 2023-03-29 11:04:12.000000000 +0200 @@ -31,8 +31,8 @@ // âââ _helpers.tp # Helm default template partials // // Overwrites existing values.yaml and templates in templates dir on every run. -func (o output) Create(chartDir, chartName string, crd bool, templates []helmify.Template) error { - err := initChartDir(chartDir, chartName, crd) +func (o output) Create(chartDir, chartName string, crd bool, certManagerAsSubchart bool, templates []helmify.Template) error { + err := initChartDir(chartDir, chartName, crd, certManagerAsSubchart) if err != nil { return err } @@ -56,7 +56,7 @@ return err } } - err = overwriteValuesFile(cDir, values) + err = overwriteValuesFile(cDir, values, certManagerAsSubchart) if err != nil { return err } @@ -101,7 +101,18 @@ return nil } -func overwriteValuesFile(chartDir string, values helmify.Values) error { +func overwriteValuesFile(chartDir string, values helmify.Values, certManagerAsSubchart bool) error { + if certManagerAsSubchart { + _, err := values.Add(true, "cert-manager", "installCRDs") + if err != nil { + return errors.Wrap(err, "unable to add cert-manager.installCRDs") + } + + _, err = values.Add(true, "cert-manager", "enabled") + if err != nil { + return errors.Wrap(err, "unable to add cert-manager.enabled") + } + } res, err := yaml.Marshal(values) if err != nil { return errors.Wrap(err, "unable to write marshal values.yaml") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/pkg/helm/init.go new/helmify-0.3.34/pkg/helm/init.go --- old/helmify-0.3.33/pkg/helm/init.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/pkg/helm/init.go 2023-03-29 11:04:12.000000000 +0200 @@ -129,7 +129,7 @@ const maxChartNameLength = 250 // initChartDir - creates Helm chart structure in chartName directory if not presented. -func initChartDir(chartDir, chartName string, crd bool) error { +func initChartDir(chartDir, chartName string, crd bool, certManagerAsSubchart bool) error { if err := validateChartName(chartName); err != nil { return err } @@ -137,7 +137,7 @@ cDir := filepath.Join(chartDir, chartName) _, err := os.Stat(filepath.Join(cDir, "Chart.yaml")) if os.IsNotExist(err) { - return createCommonFiles(chartDir, chartName, crd) + return createCommonFiles(chartDir, chartName, crd, certManagerAsSubchart) } logrus.Info("Skip creating Chart skeleton: Chart.yaml already exists.") return err @@ -153,7 +153,7 @@ return nil } -func createCommonFiles(chartDir, chartName string, crd bool) error { +func createCommonFiles(chartDir, chartName string, crd bool, certManagerAsSubchart bool) error { cDir := filepath.Join(chartDir, chartName) err := os.MkdirAll(filepath.Join(cDir, "templates"), 0750) if err != nil { @@ -175,14 +175,23 @@ logrus.WithField("file", file).Info("created") } } - createFile(chartYAML(chartName), cDir, "Chart.yaml") + createFile(chartYAML(chartName, certManagerAsSubchart), cDir, "Chart.yaml") createFile([]byte(helmIgnore), cDir, ".helmignore") createFile(helpersYAML(chartName), cDir, "templates", "_helpers.tpl") return err } -func chartYAML(appName string) []byte { - return []byte(fmt.Sprintf(defaultChartfile, appName)) +func chartYAML(appName string, certManagerAsSubchart bool) []byte { + chartFile := defaultChartfile + annotatins := ` +dependencies: + - name: cert-manager + repository: https://charts.jetstack.io + condition: certManager.enabled` + if certManagerAsSubchart { + chartFile += annotatins + } + return []byte(fmt.Sprintf(chartFile, appName)) } func helpersYAML(chartName string) []byte { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/pkg/helmify/model.go new/helmify-0.3.34/pkg/helmify/model.go --- old/helmify-0.3.33/pkg/helmify/model.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/pkg/helmify/model.go 2023-03-29 11:04:12.000000000 +0200 @@ -1,9 +1,10 @@ package helmify import ( - "github.com/arttor/helmify/pkg/config" "io" + "github.com/arttor/helmify/pkg/config" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) @@ -27,7 +28,7 @@ // Output - converts Template into helm chart on disk. type Output interface { - Create(chartName, chartDir string, Crd bool, templates []Template) error + Create(chartName, chartDir string, Crd bool, certManagerAsSubchart bool, templates []Template) error } // AppMetadata handle common information about K8s objects in the chart. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/pkg/processor/webhook/cert.go new/helmify-0.3.34/pkg/processor/webhook/cert.go --- old/helmify-0.3.33/pkg/processor/webhook/cert.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/pkg/processor/webhook/cert.go 2023-03-29 11:04:12.000000000 +0200 @@ -24,6 +24,17 @@ {{- include "%[1]s.labels" . | nindent 4 }} spec: %[3]s` + certTemplWithAnno = `apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ include "%[1]s.fullname" . }}-%[2]s + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "2" + labels: + {{- include "%[1]s.labels" . | nindent 4 }} +spec: +%[3]s` ) var certGVC = schema.GroupVersionKind{ @@ -76,7 +87,13 @@ spec, _ := yaml.Marshal(obj.Object["spec"]) spec = yamlformat.Indent(spec, 2) spec = bytes.TrimRight(spec, "\n ") - res := fmt.Sprintf(certTempl, appMeta.ChartName(), name, string(spec)) + tmpl := "" + if appMeta.Config().CertManagerAsSubchart { + tmpl = certTemplWithAnno + } else { + tmpl = certTempl + } + res := fmt.Sprintf(tmpl, appMeta.ChartName(), name, string(spec)) return true, &certResult{ name: name, data: []byte(res), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.3.33/pkg/processor/webhook/issuer.go new/helmify-0.3.34/pkg/processor/webhook/issuer.go --- old/helmify-0.3.33/pkg/processor/webhook/issuer.go 2023-03-23 16:15:12.000000000 +0100 +++ new/helmify-0.3.34/pkg/processor/webhook/issuer.go 2023-03-29 11:04:12.000000000 +0200 @@ -21,6 +21,17 @@ {{- include "%[1]s.labels" . | nindent 4 }} spec: %[3]s` + issuerTemplWithAnno = `apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: {{ include "%[1]s.fullname" . }}-%[2]s + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "1" + labels: + {{- include "%[1]s.labels" . | nindent 4 }} +spec: +%[3]s` ) var issuerGVC = schema.GroupVersionKind{ @@ -45,7 +56,13 @@ spec, _ := yaml.Marshal(obj.Object["spec"]) spec = yamlformat.Indent(spec, 2) spec = bytes.TrimRight(spec, "\n ") - res := fmt.Sprintf(issuerTempl, appMeta.ChartName(), name, string(spec)) + tmpl := "" + if appMeta.Config().CertManagerAsSubchart { + tmpl = issuerTemplWithAnno + } else { + tmpl = issuerTempl + } + res := fmt.Sprintf(tmpl, appMeta.ChartName(), name, string(spec)) return true, &issResult{ name: name, data: []byte(res), ++++++ helmify.obsinfo ++++++ --- /var/tmp/diff_new_pack.4Ddzzv/_old 2023-03-29 23:28:28.663866674 +0200 +++ /var/tmp/diff_new_pack.4Ddzzv/_new 2023-03-29 23:28:28.667866696 +0200 @@ -1,5 +1,5 @@ name: helmify -version: 0.3.33 -mtime: 1679584512 -commit: f9a41896286bb996f954e2bcf1641ec04d2d0745 +version: 0.3.34 +mtime: 1680080652 +commit: 2d1d959cc147a9e23bd7dbd5619315649c205ecc ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/helmify/vendor.tar.gz /work/SRC/openSUSE:Factory/.helmify.new.31432/vendor.tar.gz differ: char 5, line 1