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
|
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 {
|
if finalState == nil {
|
||||||
finalState = currentState
|
finalState = currentState
|
||||||
} else {
|
} 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,
|
return nil, fmt.Errorf("failed executing templates in release \"%s\".\"%s\": %s", st.FilePath, release.Name,
|
||||||
"recursive references can't be resolved")
|
"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
|
return &r, nil
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ templates:
|
||||||
- base: base
|
- base: base
|
||||||
labels:
|
labels:
|
||||||
base: base
|
base: base
|
||||||
|
chart: ../../charts/raw-0.1.0
|
||||||
template1:
|
template1:
|
||||||
values:
|
values:
|
||||||
- template1: template1
|
- template1: template1
|
||||||
|
|
@ -34,7 +35,6 @@ templates:
|
||||||
|
|
||||||
releases:
|
releases:
|
||||||
- name: foo1
|
- name: foo1
|
||||||
chart: ../../charts/raw-0.1.0
|
|
||||||
inherit:
|
inherit:
|
||||||
template: template1
|
template: template1
|
||||||
values:
|
values:
|
||||||
|
|
@ -48,7 +48,6 @@ releases:
|
||||||
data:
|
data:
|
||||||
{{` {{ (unset .Values "templates") | toYaml | nindent 2 }} `}}
|
{{` {{ (unset .Values "templates") | toYaml | nindent 2 }} `}}
|
||||||
- name: foo2
|
- name: foo2
|
||||||
chart: ../../charts/raw-0.1.0
|
|
||||||
inherit:
|
inherit:
|
||||||
template: template2
|
template: template2
|
||||||
values:
|
values:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue