mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 19:38:37 +02:00
Remove all v0.x references (#1919)
* fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * refactor(two_pass_renderer): remove unused imports and functions Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> * fix tests Signed-off-by: yxxhero <aiopsclub@163.com> --------- Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -117,20 +117,6 @@ func (c *StateCreator) Parse(content []byte, baseDir, file string) (*HelmState,
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
if len(state.DeprecatedReleases) > 0 {
|
||||
if len(state.Releases) > 0 {
|
||||
return nil, fmt.Errorf("failed to parse %s: you can't specify both `charts` and `releases` sections", file)
|
||||
}
|
||||
state.Releases = state.DeprecatedReleases
|
||||
state.DeprecatedReleases = []ReleaseSpec{}
|
||||
}
|
||||
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
if state.DeprecatedContext != "" && state.HelmDefaults.KubeContext == "" {
|
||||
state.HelmDefaults.KubeContext = state.DeprecatedContext
|
||||
}
|
||||
|
||||
if c.overrideHelmBinary != "" && c.overrideHelmBinary != DefaultHelmBinary {
|
||||
state.DefaultHelmBinary = c.overrideHelmBinary
|
||||
} else if state.DefaultHelmBinary == "" {
|
||||
|
||||
@@ -280,26 +280,6 @@ func TestReadFromYaml_StrictUnmarshalling(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
func TestReadFromYaml_DeprecatedReleaseReferences(t *testing.T) {
|
||||
yamlFile := "example/path/to/yaml/file"
|
||||
yamlContent := []byte(`charts:
|
||||
- name: myrelease
|
||||
chart: mychart
|
||||
`)
|
||||
state, err := createFromYaml(yamlContent, yamlFile, DefaultEnv, logger)
|
||||
if err != nil {
|
||||
t.Errorf("unxpected error: %v", err)
|
||||
}
|
||||
|
||||
if state.Releases[0].Name != "myrelease" {
|
||||
t.Errorf("unexpected release name: expected=myrelease actual=%s", state.Releases[0].Name)
|
||||
}
|
||||
if state.Releases[0].Chart != "mychart" {
|
||||
t.Errorf("unexpected chart name: expected=mychart actual=%s", state.Releases[0].Chart)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadFromYaml_ConflictingReleasesConfig(t *testing.T) {
|
||||
yamlFile := "example/path/to/yaml/file"
|
||||
yamlContent := []byte(`charts:
|
||||
|
||||
@@ -60,10 +60,6 @@ type ReleaseSetSpec struct {
|
||||
HelmDefaults HelmSpec `yaml:"helmDefaults,omitempty"`
|
||||
Helmfiles []SubHelmfileSpec `yaml:"helmfiles,omitempty"`
|
||||
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
DeprecatedContext string `yaml:"context,omitempty"`
|
||||
DeprecatedReleases []ReleaseSpec `yaml:"charts,omitempty"`
|
||||
|
||||
OverrideKubeContext string `yaml:"kubeContext,omitempty"`
|
||||
OverrideNamespace string `yaml:"namespace,omitempty"`
|
||||
OverrideChart string `yaml:"chart,omitempty"`
|
||||
|
||||
+7
-23
@@ -58,13 +58,9 @@ func TestHelmState_applyDefaultsTo(t *testing.T) {
|
||||
type fields struct {
|
||||
BaseChartPath string
|
||||
Context string
|
||||
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
DeprecatedReleases []ReleaseSpec
|
||||
|
||||
Namespace string
|
||||
Repositories []RepositorySpec
|
||||
Releases []ReleaseSpec
|
||||
Namespace string
|
||||
Repositories []RepositorySpec
|
||||
Releases []ReleaseSpec
|
||||
}
|
||||
type args struct {
|
||||
spec ReleaseSpec
|
||||
@@ -89,12 +85,8 @@ func TestHelmState_applyDefaultsTo(t *testing.T) {
|
||||
fieldsWithNamespace := fields{
|
||||
BaseChartPath: ".",
|
||||
Context: "test_context",
|
||||
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
DeprecatedReleases: nil,
|
||||
|
||||
Namespace: specWithNamespaceFromFields.Namespace,
|
||||
Repositories: nil,
|
||||
Namespace: specWithNamespaceFromFields.Namespace,
|
||||
Repositories: nil,
|
||||
Releases: []ReleaseSpec{
|
||||
specWithNamespace,
|
||||
},
|
||||
@@ -148,10 +140,6 @@ func TestHelmState_applyDefaultsTo(t *testing.T) {
|
||||
state := &HelmState{
|
||||
basePath: tt.fields.BaseChartPath,
|
||||
ReleaseSetSpec: ReleaseSetSpec{
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
DeprecatedContext: tt.fields.Context,
|
||||
DeprecatedReleases: tt.fields.DeprecatedReleases,
|
||||
|
||||
OverrideNamespace: tt.fields.Namespace,
|
||||
Repositories: tt.fields.Repositories,
|
||||
Releases: tt.fields.Releases,
|
||||
@@ -740,9 +728,6 @@ func TestHelmState_flagsForUpgrade(t *testing.T) {
|
||||
state := &HelmState{
|
||||
basePath: "./",
|
||||
ReleaseSetSpec: ReleaseSetSpec{
|
||||
// TODO: Remove this function once Helmfile v0.x
|
||||
DeprecatedContext: "default",
|
||||
|
||||
Releases: []ReleaseSpec{*tt.release},
|
||||
HelmDefaults: tt.defaults,
|
||||
},
|
||||
@@ -904,9 +889,8 @@ func TestHelmState_flagsForTemplate(t *testing.T) {
|
||||
state := &HelmState{
|
||||
basePath: "./",
|
||||
ReleaseSetSpec: ReleaseSetSpec{
|
||||
DeprecatedContext: "default",
|
||||
Releases: []ReleaseSpec{*tt.release},
|
||||
HelmDefaults: tt.defaults,
|
||||
Releases: []ReleaseSpec{*tt.release},
|
||||
HelmDefaults: tt.defaults,
|
||||
},
|
||||
valsRuntime: valsRuntime,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user