fix inherit chart empty check issue (#635)
Signed-off-by: yxxhero <aiopsclub@163.com> Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
parent
44b473ebe8
commit
a724ab73f6
|
|
@ -220,12 +220,6 @@ func (ld *desiredStateLoader) load(env, overrodeEnv *environment.Environment, ba
|
|||
return nil, err
|
||||
}
|
||||
|
||||
for i, r := range currentState.Releases {
|
||||
if r.Chart == "" {
|
||||
return nil, fmt.Errorf("error during %s parsing: encountered empty chart while reading release %q at index %d", id, r.Name, i)
|
||||
}
|
||||
}
|
||||
|
||||
if finalState == nil {
|
||||
finalState = currentState
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -131,6 +131,10 @@ func (st *HelmState) ExecuteTemplates() (*HelmState, error) {
|
|||
return nil, fmt.Errorf("failed executing templates in release \"%s\".\"%s\": %s", st.FilePath, release.Name,
|
||||
"recursive references can't be resolved")
|
||||
}
|
||||
|
||||
if st.Releases[i].Chart == "" {
|
||||
return nil, fmt.Errorf("encountered empty chart while reading release %q", st.Releases[i].Name)
|
||||
}
|
||||
}
|
||||
|
||||
return &r, nil
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ templates:
|
|||
- base: base
|
||||
labels:
|
||||
base: base
|
||||
chart: ../../charts/raw-0.1.0
|
||||
template1:
|
||||
values:
|
||||
- template1: template1
|
||||
|
|
@ -34,7 +35,6 @@ templates:
|
|||
|
||||
releases:
|
||||
- name: foo1
|
||||
chart: ../../charts/raw-0.1.0
|
||||
inherit:
|
||||
template: template1
|
||||
values:
|
||||
|
|
@ -48,7 +48,6 @@ releases:
|
|||
data:
|
||||
{{` {{ (unset .Values "templates") | toYaml | nindent 2 }} `}}
|
||||
- name: foo2
|
||||
chart: ../../charts/raw-0.1.0
|
||||
inherit:
|
||||
template: template2
|
||||
values:
|
||||
|
|
|
|||
Loading…
Reference in New Issue