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-04-13 14:11:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/helmify (Old)
 and      /work/SRC/openSUSE:Factory/.helmify.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "helmify"

Thu Apr 13 14:11:04 2023 rev:8 rq:1079063 version:0.4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/helmify/helmify.changes  2023-04-03 
17:47:00.073526148 +0200
+++ /work/SRC/openSUSE:Factory/.helmify.new.19717/helmify.changes       
2023-04-13 14:11:07.488426546 +0200
@@ -1,0 +2,16 @@
+Thu Apr 13 07:12:05 UTC 2023 - ka...@b1-systems.de
+
+- Update to version 0.4.1:
+  * remove extra files
+  * fixing logic
+  * fixing review comments
+  * Adding empty value for nodeSelector
+
+-------------------------------------------------------------------
+Thu Apr 13 07:08:34 UTC 2023 - ka...@b1-systems.de
+
+- Update to version 0.4.0:
+  * #100 support filesystem as a source
+  * fix: indent issue in the Makefile demo
+
+-------------------------------------------------------------------

Old:
----
  helmify-0.3.35.obscpio

New:
----
  helmify-0.4.1.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ helmify.spec ++++++
--- /var/tmp/diff_new_pack.5i1dTl/_old  2023-04-13 14:11:08.448432058 +0200
+++ /var/tmp/diff_new_pack.5i1dTl/_new  2023-04-13 14:11:08.452432081 +0200
@@ -19,7 +19,7 @@
 %define __arch_install_post export NO_BRP_STRIP_DEBUG=true
 
 Name:           helmify
-Version:        0.3.35
+Version:        0.4.1
 Release:        0
 Summary:        Creates Helm chart from Kubernetes yaml
 License:        MIT

++++++ _service ++++++
--- /var/tmp/diff_new_pack.5i1dTl/_old  2023-04-13 14:11:08.484432265 +0200
+++ /var/tmp/diff_new_pack.5i1dTl/_new  2023-04-13 14:11:08.488432288 +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.35</param>
+    <param name="revision">v0.4.1</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">enable</param>
     <param name="versionrewrite-pattern">v(.*)</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.5i1dTl/_old  2023-04-13 14:11:08.508432403 +0200
+++ /var/tmp/diff_new_pack.5i1dTl/_new  2023-04-13 14:11:08.512432426 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/arttor/helmify/</param>
-              <param 
name="changesrevision">0126096f81d7d7c585e525d6555913b7e46598c5</param></service></servicedata>
+              <param 
name="changesrevision">9e709ee1587ab637bf811837213670c1f1125ba4</param></service></servicedata>
 (No newline at EOF)
 

++++++ helmify-0.3.35.obscpio -> helmify-0.4.1.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/README.md new/helmify-0.4.1/README.md
--- old/helmify-0.3.35/README.md        2023-03-31 10:39:47.000000000 +0200
+++ new/helmify-0.4.1/README.md 2023-04-10 19:47:21.000000000 +0200
@@ -19,16 +19,35 @@
 
 ## Usage
 
-1) From file: `cat my-app.yaml | helmify mychart`
-    
-    Will create 'mychart' directory with Helm chart from yaml file with k8s 
objects.
+1) As pipe:
 
+    ```shell
+    cat my-app.yaml | helmify mychart
+    ```
+   Will create 'mychart' directory with Helm chart from yaml file with k8s 
objects.
 
-2) From directory with yamls:
     ```shell
     awk 'FNR==1 && NR!=1  {print "---"}{print}' /<my_directory>/*.yaml | 
helmify mychart
     ```
+   Will create 'mychart' directory with Helm chart from all yaml files in 
`<my_directory> `directory.
+
+2) From filesystem:
+    ```shell
+    helmify -f /my_directory/my-app.yaml mychart
+    ```
+    Will create 'mychart' directory with Helm chart from 
`my_directory/my-app.yaml`.
+    ```shell
+    helmify -f /my_directory mychart
+    ```
     Will create 'mychart' directory with Helm chart from all yaml files in 
`<my_directory> `directory.
+    ```shell
+    helmify -f /my_directory -r mychart
+    ```
+    Will create 'mychart' directory with Helm chart from all yaml files in 
`<my_directory> `directory recursively.
+    ```shell
+    helmify -f ./first_dir -f ./second_dir/my_deployment.yaml -f ./third_dir  
mychart
+    ```
+    Will create 'mychart' directory with Helm chart from multiple directories 
and files.
 
 
 3) From [kustomize](https://kustomize.io/) output:
@@ -58,10 +77,10 @@
     .PHONY: helmify
     helmify: $(HELMIFY) ## Download helmify locally if necessary.
     $(HELMIFY): $(LOCALBIN)
-        test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install 
github.com/arttor/helmify/cmd/helmify@latest
+       test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install 
github.com/arttor/helmify/cmd/helmify@latest
         
     helm: manifests kustomize helmify
-       $(KUSTOMIZE) build config/default | $(HELMIFY)
+       $(KUSTOMIZE) build config/default | $(HELMIFY)
     ```
 3. Run `make helm` in project root. It will generate helm chart with name 
'chart' in 'chart' directory.
 
@@ -78,15 +97,17 @@
 
 ```helmify [flags] CHART_NAME```  -  `CHART_NAME` is optional. Default is 
'chart'. Can be a directory, e.g. 'deploy/charts/mychart'.
 
-| flag | description                                                           
                                                                                
                                                      | sample |
-| --- | --- | --- |
-| -h -help | Prints help                                                       
                                                                                
                                                          | `helmify -h`|
-| -v | Enable verbose output. Prints WARN and INFO.                            
                                                                                
                                                    | `helmify -v`|
-| -vv | Enable very verbose output. Also prints DEBUG.                         
                                                                                
                                                     | `helmify -vv`|
-| -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`|
+| flag                      | description                                      
                                                                                
                                                                           | 
sample                              |
+|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
+| -h -help                  | Prints help                                      
                                                                                
                                                                           | 
`helmify -h`                        |
+| -f                        | File source for k8s manifests (directory or 
file), multiple sources supported                                               
                                                                                
| `helmify -f ./test_data`            |
+| -r                        | Scan file directory recursively. Used only if -f 
provided                                                                        
                                                                           | 
`helmify -f ./test_data -r`         |
+| -v                        | Enable verbose output. Prints WARN and INFO.     
                                                                                
                                                                           | 
`helmify -v`                        |
+| -vv                       | Enable very verbose output. Also prints DEBUG.   
                                                                                
                                                                           | 
`helmify -vv`                       |
+| -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.35/cmd/helmify/flags.go 
new/helmify-0.4.1/cmd/helmify/flags.go
--- old/helmify-0.3.35/cmd/helmify/flags.go     2023-03-31 10:39:47.000000000 
+0200
+++ new/helmify-0.4.1/cmd/helmify/flags.go      2023-04-10 19:47:21.000000000 
+0200
@@ -5,6 +5,7 @@
        "fmt"
        "os"
        "path/filepath"
+       "strings"
 
        "github.com/arttor/helmify/pkg/config"
 )
@@ -17,7 +18,16 @@
 Example 2: 'cat my-app.yaml | helmify mychart' 
   - will create 'mychart' directory with Helm chart from yaml file.
 
-Example 3: 'awk 'FNR==1 && NR!=1  {print "---"}{print}' /my_directory/*.yaml | 
helmify mychart' 
+Example 3: 'helmify -f ./test_data/dir  mychart' 
+  - will scan directory ./test_data/dir for files with k8s manifests and 
create 'mychart' directory with Helm chart.
+
+Example 4: 'helmify -f ./test_data/dir -r  mychart' 
+  - will scan directory ./test_data/dir recursively and  create 'mychart' 
directory with Helm chart.
+
+Example 5: 'helmify -f ./test_data/dir -f ./test_data/sample-app.yaml -f 
./test_data/dir/another_dir  mychart' 
+  - will scan provided multiple files and directories and  create 'mychart' 
directory with Helm chart.
+
+Example 6: 'awk 'FNR==1 && NR!=1  {print "---"}{print}' /my_directory/*.yaml | 
helmify mychart' 
   - will create 'mychart' directory with Helm chart from all yaml files in 
my_directory directory.
 
 Usage:
@@ -26,8 +36,23 @@
 Flags:
 `
 
+type arrayFlags []string
+
+func (i *arrayFlags) String() string {
+       if i == nil || len(*i) == 0 {
+               return ""
+       }
+       return strings.Join(*i, ", ")
+}
+
+func (i *arrayFlags) Set(value string) error {
+       *i = append(*i, value)
+       return nil
+}
+
 // ReadFlags command-line flags into app config.
 func ReadFlags() config.Config {
+       files := arrayFlags{}
        result := config.Config{}
        var h, help, version, crd bool
        flag.BoolVar(&h, "h", false, "Print help. Example: helmify -h")
@@ -39,6 +64,8 @@
        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.BoolVar(&result.FilesRecursively, "r", false, "Scan dirs from -f 
option recursively")
+       flag.Var(&files, "f", "File or directory containing k8s manifests")
 
        flag.Parse()
        if h || help {
@@ -58,5 +85,6 @@
        if crd {
                result.Crd = crd
        }
+       result.Files = files
        return result
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/cmd/helmify/main.go 
new/helmify-0.4.1/cmd/helmify/main.go
--- old/helmify-0.3.35/cmd/helmify/main.go      2023-03-31 10:39:47.000000000 
+0200
+++ new/helmify-0.4.1/cmd/helmify/main.go       2023-04-10 19:47:21.000000000 
+0200
@@ -14,7 +14,7 @@
                logrus.WithError(err).Error("stdin error")
                os.Exit(1)
        }
-       if (stat.Mode() & os.ModeCharDevice) != 0 {
+       if len(conf.Files) == 0 && (stat.Mode()&os.ModeCharDevice) != 0 {
                logrus.Error("no data piped in stdin")
                os.Exit(1)
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/pkg/app/app.go 
new/helmify-0.4.1/pkg/app/app.go
--- old/helmify-0.3.35/pkg/app/app.go   2023-03-31 10:39:47.000000000 +0200
+++ new/helmify-0.4.1/pkg/app/app.go    2023-04-10 19:47:21.000000000 +0200
@@ -2,6 +2,7 @@
 
 import (
        "context"
+       "github.com/arttor/helmify/pkg/file"
        "github.com/arttor/helmify/pkg/processor/job"
        "github.com/arttor/helmify/pkg/processor/statefulset"
        "io"
@@ -27,7 +28,7 @@
 )
 
 // Start - application entrypoint for processing input to a Helm chart.
-func Start(input io.Reader, config config.Config) error {
+func Start(stdin io.Reader, config config.Config) error {
        err := config.Validate()
        if err != nil {
                return err
@@ -42,7 +43,6 @@
                logrus.Debug("Received termination, signaling shutdown")
                cancelFunc()
        }()
-       objects := decoder.Decode(ctx.Done(), input)
        appCtx := New(config, helm.NewOutput())
        appCtx = appCtx.WithProcessors(
                configmap.New(),
@@ -65,9 +65,20 @@
                job.NewCron(),
                job.NewJob(),
        ).WithDefaultProcessor(processor.Default())
-       for obj := range objects {
-               appCtx.Add(obj)
+       if len(config.Files) != 0 {
+               file.Walk(config.Files, config.FilesRecursively, func(filename 
string, fileReader io.Reader) {
+                       objects := decoder.Decode(ctx.Done(), fileReader)
+                       for obj := range objects {
+                               appCtx.Add(obj, filename)
+                       }
+               })
+       } else {
+               objects := decoder.Decode(ctx.Done(), stdin)
+               for obj := range objects {
+                       appCtx.Add(obj, "")
+               }
        }
+
        return appCtx.CreateHelm(ctx.Done())
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/pkg/app/context.go 
new/helmify-0.4.1/pkg/app/context.go
--- old/helmify-0.3.35/pkg/app/context.go       2023-03-31 10:39:47.000000000 
+0200
+++ new/helmify-0.4.1/pkg/app/context.go        2023-04-10 19:47:21.000000000 
+0200
@@ -16,6 +16,7 @@
        config           config.Config
        appMeta          *metadata.Service
        objects          []*unstructured.Unstructured
+       fileNames        []string
 }
 
 // New returns context with config set.
@@ -40,10 +41,11 @@
 }
 
 // Add k8s object to app context.
-func (c *appContext) Add(obj *unstructured.Unstructured) {
+func (c *appContext) Add(obj *unstructured.Unstructured, filename string) {
        // we need to add all objects before start processing only to define 
app metadata.
        c.appMeta.Load(obj)
        c.objects = append(c.objects, obj)
+       c.fileNames = append(c.fileNames, filename)
 }
 
 // CreateHelm creates helm chart from context k8s objects.
@@ -53,13 +55,19 @@
                "Namespace": c.appMeta.Namespace(),
        }).Info("creating a chart")
        var templates []helmify.Template
-       for _, obj := range c.objects {
+       var filenames []string
+       for i, obj := range c.objects {
                template, err := c.process(obj)
                if err != nil {
                        return err
                }
                if template != nil {
                        templates = append(templates, template)
+                       filename := template.Filename()
+                       if c.fileNames[i] != "" {
+                               filename = c.fileNames[i]
+                       }
+                       filenames = append(filenames, filename)
                }
                select {
                case <-stop:
@@ -67,7 +75,7 @@
                default:
                }
        }
-       return c.output.Create(c.config.ChartDir, c.config.ChartName, 
c.config.Crd, c.config.CertManagerAsSubchart, templates)
+       return c.output.Create(c.config.ChartDir, c.config.ChartName, 
c.config.Crd, c.config.CertManagerAsSubchart, templates, filenames)
 }
 
 func (c *appContext) process(obj *unstructured.Unstructured) 
(helmify.Template, error) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/pkg/config/config.go 
new/helmify-0.4.1/pkg/config/config.go
--- old/helmify-0.3.35/pkg/config/config.go     2023-03-31 10:39:47.000000000 
+0200
+++ new/helmify-0.4.1/pkg/config/config.go      2023-04-10 19:47:21.000000000 
+0200
@@ -28,6 +28,10 @@
        GenerateDefaults bool
        // CertManagerAsSubchart enables the generation of a subchart for 
cert-manager
        CertManagerAsSubchart bool
+       // Files - directories or files with k8s manifests
+       Files []string
+       // FilesRecursively read Files recursively
+       FilesRecursively bool
 }
 
 func (c *Config) Validate() error {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/pkg/file/reader.go 
new/helmify-0.4.1/pkg/file/reader.go
--- old/helmify-0.3.35/pkg/file/reader.go       1970-01-01 01:00:00.000000000 
+0100
+++ new/helmify-0.4.1/pkg/file/reader.go        2023-04-10 19:47:21.000000000 
+0200
@@ -0,0 +1,87 @@
+package file
+
+import (
+       "github.com/sirupsen/logrus"
+       "io"
+       "io/fs"
+       "os"
+       "path/filepath"
+)
+
+func Walk(paths []string, recursively bool, walkFunc func(filename string, r 
io.Reader)) {
+
+       for _, path := range paths {
+               info, err := os.Stat(path)
+               if err != nil {
+                       logrus.Warnf("no such file or directory %q: %v", path, 
err)
+                       continue
+               }
+               // handle single file file:
+               if !info.IsDir() {
+                       file, err := os.Open(path)
+                       if err != nil {
+                               logrus.Warnf("unable to open file %q: %v", 
file.Name(), err)
+                               continue
+                       }
+                       walkFunc(info.Name(), file)
+                       err = file.Close()
+                       if err != nil {
+                               logrus.Warnf("unable to close file %q: %v", 
file.Name(), err)
+                       }
+                       continue
+               }
+               // handle directory non-recursively:
+               if !recursively {
+                       dir, err := os.Open(path)
+                       if err != nil {
+                               logrus.Warnf("unable to open directory %q: %v", 
dir.Name(), err)
+                               continue
+                       }
+                       files, err := dir.ReadDir(0)
+                       if err != nil {
+                               logrus.Warnf("unable to read directory %q: %v", 
dir.Name(), err)
+                               continue
+                       }
+                       for _, f := range files {
+                               if f.IsDir() {
+                                       continue
+                               }
+                               file, err := os.Open(filepath.Join(path, 
f.Name()))
+                               if err != nil {
+                                       logrus.Warnf("unable to open file %q: 
%v", file.Name(), err)
+                                       continue
+                               }
+                               walkFunc(f.Name(), file)
+                               err = file.Close()
+                               if err != nil {
+                                       logrus.Warnf("unable to close file %q: 
%v", file.Name(), err)
+                               }
+                               continue
+                       }
+                       continue
+               }
+               // handle directory recursively:
+               err = filepath.WalkDir(path, func(path string, d fs.DirEntry, 
err error) error {
+                       if err != nil {
+                               return err
+                       }
+                       if d.IsDir() {
+                               return nil
+                       }
+                       file, err := os.Open(path)
+                       if err != nil {
+                               return err
+                       }
+                       walkFunc(d.Name(), file)
+                       err = file.Close()
+                       if err != nil {
+                               logrus.Warnf("unable to close file %q: %v", 
file.Name(), err)
+                       }
+                       return nil
+               })
+               if err != nil {
+                       logrus.Warnf("unable to open %q: %v", info.Name(), err)
+                       continue
+               }
+       }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/pkg/helm/chart.go 
new/helmify-0.4.1/pkg/helm/chart.go
--- old/helmify-0.3.35/pkg/helm/chart.go        2023-03-31 10:39:47.000000000 
+0200
+++ new/helmify-0.4.1/pkg/helm/chart.go 2023-04-10 19:47:21.000000000 +0200
@@ -31,7 +31,7 @@
 //         └── _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, 
certManagerAsSubchart bool, templates []helmify.Template) error {
+func (o output) Create(chartDir, chartName string, crd bool, 
certManagerAsSubchart bool, templates []helmify.Template, filenames []string) 
error {
        err := initChartDir(chartDir, chartName, crd, certManagerAsSubchart)
        if err != nil {
                return err
@@ -40,10 +40,10 @@
        files := map[string][]helmify.Template{}
        values := helmify.Values{}
        values[cluster.DomainKey] = cluster.DefaultDomain
-       for _, template := range templates {
-               file := files[template.Filename()]
+       for i, template := range templates {
+               file := files[filenames[i]]
                file = append(file, template)
-               files[template.Filename()] = file
+               files[filenames[i]] = file
                err = values.Merge(template.Values())
                if err != nil {
                        return err
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/pkg/helmify/model.go 
new/helmify-0.4.1/pkg/helmify/model.go
--- old/helmify-0.3.35/pkg/helmify/model.go     2023-03-31 10:39:47.000000000 
+0200
+++ new/helmify-0.4.1/pkg/helmify/model.go      2023-04-10 19:47:21.000000000 
+0200
@@ -28,7 +28,7 @@
 
 // Output - converts Template into helm chart on disk.
 type Output interface {
-       Create(chartName, chartDir string, Crd bool, certManagerAsSubchart 
bool, templates []Template) error
+       Create(chartName, chartDir string, Crd bool, certManagerAsSubchart 
bool, templates []Template, filenames []string) 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.35/pkg/processor/pod/pod.go 
new/helmify-0.4.1/pkg/processor/pod/pod.go
--- old/helmify-0.3.35/pkg/processor/pod/pod.go 2023-03-31 10:39:47.000000000 
+0200
+++ new/helmify-0.4.1/pkg/processor/pod/pod.go  2023-04-10 19:47:21.000000000 
+0200
@@ -2,6 +2,8 @@
 
 import (
        "fmt"
+       "strings"
+
        "github.com/arttor/helmify/pkg/cluster"
        "github.com/arttor/helmify/pkg/helmify"
        securityContext 
"github.com/arttor/helmify/pkg/processor/security-context"
@@ -9,7 +11,6 @@
        corev1 "k8s.io/api/core/v1"
        "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
        "k8s.io/apimachinery/pkg/runtime"
-       "strings"
 )
 
 const imagePullPolicyTemplate = "{{ .Values.%[1]s.%[2]s.imagePullPolicy }}"
@@ -73,7 +74,7 @@
        }
 
        // process nodeSelector if presented:
-       if len(spec.NodeSelector) != 0 {
+       if spec.NodeSelector != nil {
                err = unstructured.SetNestedField(specMap, fmt.Sprintf(`{{- 
toYaml .Values.%s.nodeSelector | nindent 8 }}`, objName), "nodeSelector")
                if err != nil {
                        return nil, nil, err
@@ -83,6 +84,7 @@
                        return nil, nil, err
                }
        }
+
        return specMap, values, nil
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/helmify-0.3.35/test_data/dir/another_dir/stateful_set.yaml 
new/helmify-0.4.1/test_data/dir/another_dir/stateful_set.yaml
--- old/helmify-0.3.35/test_data/dir/another_dir/stateful_set.yaml      
1970-01-01 01:00:00.000000000 +0100
+++ new/helmify-0.4.1/test_data/dir/another_dir/stateful_set.yaml       
2023-04-10 19:47:21.000000000 +0200
@@ -0,0 +1,32 @@
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: web
+spec:
+  serviceName: "nginx"
+  replicas: 2
+  selector:
+    matchLabels:
+      app: nginx
+  template:
+    metadata:
+      labels:
+        app: nginx
+    spec:
+      containers:
+        - name: nginx
+          image: registry.k8s.io/nginx-slim:0.8
+          ports:
+            - containerPort: 80
+              name: web
+          volumeMounts:
+            - name: www
+              mountPath: /usr/share/nginx/html
+  volumeClaimTemplates:
+    - metadata:
+        name: www
+      spec:
+        accessModes: [ "ReadWriteOnce" ]
+        resources:
+          requests:
+            storage: 1Gi
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/test_data/dir/config.yaml 
new/helmify-0.4.1/test_data/dir/config.yaml
--- old/helmify-0.3.35/test_data/dir/config.yaml        1970-01-01 
01:00:00.000000000 +0100
+++ new/helmify-0.4.1/test_data/dir/config.yaml 2023-04-10 19:47:21.000000000 
+0200
@@ -0,0 +1,31 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: my-config
+  namespace: my-ns
+immutable: true
+data:
+  dummyconfigmapkey: dummyconfigmapvalue
+  my_config.properties: |
+    health.healthProbeBindAddress=8081
+    metrics.bindAddress=127.0.0.1:8080
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: my-config-props
+  namespace: my-ns
+data:
+  my.prop1: "1"
+  my.prop2: "val 1"
+  my.prop3: "true"
+  myval.yaml: |
+    apiVersion: clickhouse.altinity.com/v1
+    kind: ClickHouseInstallationTemplate
+    metadata:
+      name: default-oneperhost-pod-template
+    spec:
+      templates:
+        podTemplates: 
+          - name: default-oneperhost-pod-template
+            distribution: "OnePerHost"
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/test_data/dir/deployment.yaml 
new/helmify-0.4.1/test_data/dir/deployment.yaml
--- old/helmify-0.3.35/test_data/dir/deployment.yaml    1970-01-01 
01:00:00.000000000 +0100
+++ new/helmify-0.4.1/test_data/dir/deployment.yaml     2023-04-10 
19:47:21.000000000 +0200
@@ -0,0 +1,95 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  labels:
+    app: myapp
+  name: myapp
+  namespace: my-ns
+spec:
+  replicas: 3
+  selector:
+    matchLabels:
+      app: myapp
+  template:
+    metadata:
+      labels:
+        app: myapp
+    spec:
+      containers:
+        - name: app
+          args:
+            - --health-probe-bind-address=:8081
+            - --metrics-bind-address=127.0.0.1:8080
+            - --leader-elect
+          command:
+            - /manager
+          volumeMounts:
+            - mountPath: /my_config.properties
+              name: manager-config
+              subPath: my_config.properties
+            - name: secret-volume
+              mountPath: /my.ca
+            - name: props
+              mountPath: /etc/props
+            - name: sample-pv-storage
+              mountPath: "/usr/share/nginx/html"
+          env:
+            - name: VAR1
+              valueFrom:
+                secretKeyRef:
+                  name: my-secret-vars
+                  key: VAR1
+            - name: VAR2
+              valueFrom:
+                secretKeyRef:
+                  name: my-secret-vars
+                  key: VAR2
+          image: controller:latest
+          livenessProbe:
+            httpGet:
+              path: /healthz
+              port: 8081
+            initialDelaySeconds: 15
+            periodSeconds: 20
+          readinessProbe:
+            httpGet:
+              path: /readyz
+              port: 8081
+            initialDelaySeconds: 5
+            periodSeconds: 10
+          resources:
+            limits:
+              cpu: 100m
+              memory: 30Mi
+            requests:
+              cpu: 100m
+              memory: 20Mi
+          securityContext:
+            allowPrivilegeEscalation: false
+        - name: proxy-sidecar
+          args:
+            - --secure-listen-address=0.0.0.0:8443
+            - --v=10
+          image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
+          ports:
+            - containerPort: 8443
+              name: https
+      securityContext:
+        runAsNonRoot: true
+      nodeSelector:
+        region: east
+        type: user-node
+      terminationGracePeriodSeconds: 10
+      volumes:
+        - configMap:
+            name: my-config
+          name: manager-config
+        - configMap:
+            name: my-config-props
+          name: props
+        - name: secret-volume
+          secret:
+            secretName: my-secret-ca
+        - name: sample-pv-storage
+          persistentVolumeClaim:
+            claimName: my-sample-pv-claim
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/test_data/dir/secret.yaml 
new/helmify-0.4.1/test_data/dir/secret.yaml
--- old/helmify-0.3.35/test_data/dir/secret.yaml        1970-01-01 
01:00:00.000000000 +0100
+++ new/helmify-0.4.1/test_data/dir/secret.yaml 2023-04-10 19:47:21.000000000 
+0200
@@ -0,0 +1,30 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: my-secret-ca
+  namespace: my-ns
+type: opaque
+data:
+  ca.crt: |
+    c3VwZXJsb25ndGVzdGNydC1zdXBlcmxvbmd0ZXN0Y3J0LXN1cGVybG9uZ3Rlc3RjcnQtc3
+    VwZXJsb25ndGVzdGNydC1zdXBlcmxvbmd0ZXN0Y3J0LXN1cGVybG9uZ3Rlc3RjcnQtc3Vw
+    ZXJsb25ndGVzdGNydC0Kc3VwZXJsb25ndGVzdGNydC1zdXBlcmxvbmd0ZXN0Y3J0LXN1cG
+    VybG9uZ3Rlc3RjcnQtc3VwZXJsb25ndGVzdGNydC1zdXBlcmxvbmd0ZXN0Y3J0LXN1cGVy
+    bG9uZ3Rlc3RjcnQKc3VwZXJsb25ndGVzdGNydC1zdXBlcmxvbmd0ZXN0Y3J0LXN1cGVybG
+    9uZ3Rlc3RjcnQtc3VwZXJsb25ndGVzdGNydC1zdXBlcmxvbmd0ZXN0Y3J0LXN1cGVybG9u
+    Z3Rlc3RjcnQ=
+---
+apiVersion: v1
+kind: Secret
+metadata:
+  name: my-secret-vars
+  namespace: my-ns
+type: opaque
+data:
+  VAR1: bXlfc2VjcmV0X3Zhcl8x
+  VAR2: bXlfc2VjcmV0X3Zhcl8y
+  ELASTIC_FOOBAR_HUNTER123_MEOWTOWN_VERIFY: bXlfc2VjcmV0X3Zhcl8y
+stringData:
+  str: |
+    some big not so secret string with
+    multiple lines
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/test_data/dir/service.yaml 
new/helmify-0.4.1/test_data/dir/service.yaml
--- old/helmify-0.3.35/test_data/dir/service.yaml       1970-01-01 
01:00:00.000000000 +0100
+++ new/helmify-0.4.1/test_data/dir/service.yaml        2023-04-10 
19:47:21.000000000 +0200
@@ -0,0 +1,32 @@
+apiVersion: v1
+kind: Service
+metadata:
+  labels:
+    app: myapp
+  name: myapp-service
+  namespace: my-ns
+spec:
+  ports:
+    - name: https
+      port: 8443
+      targetPort: https
+  selector:
+    app: myapp
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: myapp-ingress
+  annotations:
+    nginx.ingress.kubernetes.io/rewrite-target: /
+spec:
+  rules:
+    - http:
+        paths:
+          - path: /testpath
+            pathType: Prefix
+            backend:
+              service:
+                name: myapp-service
+                port:
+                  number: 8443
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/helmify-0.3.35/test_data/dir/storage.yaml 
new/helmify-0.4.1/test_data/dir/storage.yaml
--- old/helmify-0.3.35/test_data/dir/storage.yaml       1970-01-01 
01:00:00.000000000 +0100
+++ new/helmify-0.4.1/test_data/dir/storage.yaml        2023-04-10 
19:47:21.000000000 +0200
@@ -0,0 +1,13 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: my-sample-pv-claim
+spec:
+  storageClassName: manual
+  accessModes:
+    - ReadWriteOnce
+  resources:
+    requests:
+      storage: 3Gi
+    limits:
+      storage: 5Gi
\ No newline at end of file

++++++ helmify.obsinfo ++++++
--- /var/tmp/diff_new_pack.5i1dTl/_old  2023-04-13 14:11:08.664433298 +0200
+++ /var/tmp/diff_new_pack.5i1dTl/_new  2023-04-13 14:11:08.668433322 +0200
@@ -1,5 +1,5 @@
 name: helmify
-version: 0.3.35
-mtime: 1680251987
-commit: 0126096f81d7d7c585e525d6555913b7e46598c5
+version: 0.4.1
+mtime: 1681148841
+commit: 9e709ee1587ab637bf811837213670c1f1125ba4
 

++++++ vendor.tar.gz ++++++
/work/SRC/openSUSE:Factory/helmify/vendor.tar.gz 
/work/SRC/openSUSE:Factory/.helmify.new.19717/vendor.tar.gz differ: char 5, 
line 1

Reply via email to