Skip to content

Commit 9a750c5

Browse files
committed
fix sections extract if only HOOKS sections is present
1 parent a50d670 commit 9a750c5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cmd/helm3.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,18 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) {
177177

178178
i := bytes.Index(s, []byte("HOOKS:"))
179179
s = s[i:]
180-
181180
i = bytes.Index(s, []byte("---"))
182181
s = s[i:]
183-
184182
i = bytes.Index(s, []byte("MANIFEST:"))
185-
186183
if i != -1 {
187184
j := bytes.Index(s[i:], []byte("---"))
188-
s = append(s[:i], s[i:][j:]...)
189-
}
190185

186+
if j != -1 {
187+
s = append(s[:i], s[i:][j:]...)
188+
} else {
189+
s = s[:i]
190+
}
191+
}
191192
i = bytes.Index(s, []byte("\nNOTES:"))
192193
if i != -1 {
193194
s = s[:i+1]

0 commit comments

Comments
 (0)