commit helmify for openSUSE:Factory
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-10-30 22:10:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/helmify (Old) and /work/SRC/openSUSE:Factory/.helmify.new.17445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "helmify" Mon Oct 30 22:10:55 2023 rev:15 rq:1121119 version:0.4.8 Changes: -------- --- /work/SRC/openSUSE:Factory/helmify/helmify.changes 2023-10-24 20:09:10.250299392 +0200 +++ /work/SRC/openSUSE:Factory/.helmify.new.17445/helmify.changes 2023-10-30 22:11:20.593451486 +0100 @@ -1,0 +2,6 @@ +Mon Oct 30 09:30:46 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.4.8: + * feat: add deployment revisionHistoryLimit + +------------------------------------------------------------------- Old: ---- helmify-0.4.7.obscpio New: ---- helmify-0.4.8.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ helmify.spec ++++++ --- /var/tmp/diff_new_pack.VJ13ne/_old 2023-10-30 22:11:22.809533241 +0100 +++ /var/tmp/diff_new_pack.VJ13ne/_new 2023-10-30 22:11:22.817533536 +0100 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: helmify -Version: 0.4.7 +Version: 0.4.8 Release: 0 Summary: Creates Helm chart from Kubernetes yaml License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.VJ13ne/_old 2023-10-30 22:11:23.053542244 +0100 +++ /var/tmp/diff_new_pack.VJ13ne/_new 2023-10-30 22:11:23.077543129 +0100 @@ -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.4.7</param> + <param name="revision">v0.4.8</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.VJ13ne/_old 2023-10-30 22:11:23.197547556 +0100 +++ /var/tmp/diff_new_pack.VJ13ne/_new 2023-10-30 22:11:23.221548442 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/arttor/helmify/</param> - <param name="changesrevision">8a688a5448fbadeb0072b1babd7905f8b276fb62</param></service></servicedata> + <param name="changesrevision">0b64abb651cc07212596451bec33cfc804db85ed</param></service></servicedata> (No newline at EOF) ++++++ helmify-0.4.7.obscpio -> helmify-0.4.8.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.4.7/examples/app/templates/deployment.yaml new/helmify-0.4.8/examples/app/templates/deployment.yaml --- old/helmify-0.4.7/examples/app/templates/deployment.yaml 2023-10-24 09:49:46.000000000 +0200 +++ new/helmify-0.4.8/examples/app/templates/deployment.yaml 2023-10-30 08:57:41.000000000 +0100 @@ -7,6 +7,7 @@ {{- include "app.labels" . | nindent 4 }} spec: replicas: {{ .Values.myapp.replicas }} + revisionHistoryLimit: {{ .Values.myapp.revisionHistoryLimit }} selector: matchLabels: app: myapp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.4.7/examples/app/values.yaml new/helmify-0.4.8/examples/app/values.yaml --- old/helmify-0.4.7/examples/app/values.yaml 2023-10-24 09:49:46.000000000 +0200 +++ new/helmify-0.4.8/examples/app/values.yaml 2023-10-30 08:57:41.000000000 +0100 @@ -84,6 +84,7 @@ repository: gcr.io/kubebuilder/kube-rbac-proxy tag: v0.8.0 replicas: 3 + revisionHistoryLimit: 5 myappPdb: minAvailable: 2 myappService: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.4.7/pkg/processor/deployment/deployment.go new/helmify-0.4.8/pkg/processor/deployment/deployment.go --- old/helmify-0.4.7/pkg/processor/deployment/deployment.go 2023-10-24 09:49:46.000000000 +0200 +++ new/helmify-0.4.8/pkg/processor/deployment/deployment.go 2023-10-30 08:57:41.000000000 +0100 @@ -30,6 +30,9 @@ {{- if .Replicas }} {{ .Replicas }} {{- end }} +{{- if .RevisionHistoryLimit }} +{{ .RevisionHistoryLimit }} +{{- end }} selector: {{ .Selector }} template: @@ -57,6 +60,7 @@ return false, nil, nil } depl := appsv1.Deployment{} + err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &depl) if err != nil { return true, nil, fmt.Errorf("%w: unable to cast to deployment", err) @@ -74,6 +78,11 @@ return true, nil, err } + revisionHistoryLimit, err := processRevisionHistoryLimit(name, &depl, &values) + if err != nil { + return true, nil, err + } + matchLabels, err := yamlformat.Marshal(map[string]interface{}{"matchLabels": depl.Spec.Selector.MatchLabels}, 0) if err != nil { return true, nil, err @@ -125,19 +134,21 @@ return true, &result{ values: values, data: struct { - Meta string - Replicas string - Selector string - PodLabels string - PodAnnotations string - Spec string + Meta string + Replicas string + RevisionHistoryLimit string + Selector string + PodLabels string + PodAnnotations string + Spec string }{ - Meta: meta, - Replicas: replicas, - Selector: selector, - PodLabels: podLabels, - PodAnnotations: podAnnotations, - Spec: spec, + Meta: meta, + Replicas: replicas, + RevisionHistoryLimit: revisionHistoryLimit, + Selector: selector, + PodLabels: podLabels, + PodAnnotations: podAnnotations, + Spec: spec, }, }, nil } @@ -158,14 +169,31 @@ return replicas, nil } +func processRevisionHistoryLimit(name string, deployment *appsv1.Deployment, values *helmify.Values) (string, error) { + if deployment.Spec.RevisionHistoryLimit == nil { + return "", nil + } + revisionHistoryLimitTpl, err := values.Add(int64(*deployment.Spec.RevisionHistoryLimit), name, "revisionHistoryLimit") + if err != nil { + return "", err + } + revisionHistoryLimit, err := yamlformat.Marshal(map[string]interface{}{"revisionHistoryLimit": revisionHistoryLimitTpl}, 2) + if err != nil { + return "", err + } + revisionHistoryLimit = strings.ReplaceAll(revisionHistoryLimit, "'", "") + return revisionHistoryLimit, nil +} + type result struct { data struct { - Meta string - Replicas string - Selector string - PodLabels string - PodAnnotations string - Spec string + Meta string + Replicas string + RevisionHistoryLimit string + Selector string + PodLabels string + PodAnnotations string + Spec string } values helmify.Values } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.4.7/pkg/processor/deployment/deployment_test.go new/helmify-0.4.8/pkg/processor/deployment/deployment_test.go --- old/helmify-0.4.7/pkg/processor/deployment/deployment_test.go 2023-10-24 09:49:46.000000000 +0200 +++ new/helmify-0.4.8/pkg/processor/deployment/deployment_test.go 2023-10-30 08:57:41.000000000 +0100 @@ -18,6 +18,7 @@ name: my-operator-controller-manager namespace: my-operator-system spec: + revisionHistoryLimit: 5 replicas: 1 selector: matchLabels: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.4.7/test_data/k8s-operator-ci.yaml new/helmify-0.4.8/test_data/k8s-operator-ci.yaml --- old/helmify-0.4.7/test_data/k8s-operator-ci.yaml 2023-10-24 09:49:46.000000000 +0200 +++ new/helmify-0.4.8/test_data/k8s-operator-ci.yaml 2023-10-30 08:57:41.000000000 +0100 @@ -14,7 +14,7 @@ creationTimestamp: null name: cephvolumes.test.example.com labels: - example-label: my-app + example-label: my-app spec: group: test.example.com names: @@ -570,6 +570,7 @@ namespace: my-operator-system spec: replicas: 1 + revisionHistoryLimit: 5 selector: matchLabels: control-plane: controller-manager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/helmify-0.4.7/test_data/sample-app.yaml new/helmify-0.4.8/test_data/sample-app.yaml --- old/helmify-0.4.7/test_data/sample-app.yaml 2023-10-24 09:49:46.000000000 +0200 +++ new/helmify-0.4.8/test_data/sample-app.yaml 2023-10-30 08:57:41.000000000 +0100 @@ -7,6 +7,7 @@ namespace: my-ns spec: replicas: 3 + revisionHistoryLimit: 5 selector: matchLabels: app: myapp ++++++ helmify.obsinfo ++++++ --- /var/tmp/diff_new_pack.VJ13ne/_old 2023-10-30 22:11:23.777568954 +0100 +++ /var/tmp/diff_new_pack.VJ13ne/_new 2023-10-30 22:11:23.797569692 +0100 @@ -1,5 +1,5 @@ name: helmify -version: 0.4.7 -mtime: 1698133786 -commit: 8a688a5448fbadeb0072b1babd7905f8b276fb62 +version: 0.4.8 +mtime: 1698652661 +commit: 0b64abb651cc07212596451bec33cfc804db85ed ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/helmify/vendor.tar.gz /work/SRC/openSUSE:Factory/.helmify.new.17445/vendor.tar.gz differ: char 5, line 1
participants (1)
-
Source-Sync