New ๐ŸŒŠ wave for @helm

Commit 03edb56c

03edb56cfe02Merged

zhilyaev <[email protected]> ยท 5 years ago ยท 2 files ยท +1 added ยท ~1 modified

Description

fix zero release and zero values

Details

Commit
03edb56cfe02
Parent
4c96f63cdd22

pkg/plan/export.gomodifiedView file

@@ -29,6 +29,10 @@
2929 }
3030
3131 func (p *Plan) exportManifest() error {
32+ if len(p.body.Releases) == 0 {
33+ return nil
34+ }
35+
3236 for k, v := range p.manifests {
3337 m := filepath.Join(p.dir, Manifest, string(k))
3438
@@ -66,6 +70,22 @@
6670 }
6771
6872 func (p *Plan) exportValues() error {
73+ if len(p.body.Releases) == 0 {
74+ return nil
75+ }
76+
77+ found := false
78+ for i := 0; i < len(p.body.Releases)-1 && !found; i++ {
79+ for range p.body.Releases[i].Values {
80+ found = true
81+ break
82+ }
83+ }
84+
85+ if !found {
86+ return nil
87+ }
88+
6989 return os.Rename(
7090 filepath.Join(p.tmpDir, Values),
7191 filepath.Join(p.dir, Values),