|
|
|
@ -42,7 +42,7 @@ func TestRequirementsTagsNonValue(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags with no effect
|
|
|
|
|
v := &chart.Config{Raw: string("tags:\n nothinguseful: false\n\n")}
|
|
|
|
|
v := &chart.Config{Raw: "tags:\n nothinguseful: false\n\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart1", "subcharta", "subchartb"}
|
|
|
|
|
|
|
|
|
@ -54,7 +54,7 @@ func TestRequirementsTagsDisabledL1(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags disabling a group
|
|
|
|
|
v := &chart.Config{Raw: string("tags:\n front-end: false\n\n")}
|
|
|
|
|
v := &chart.Config{Raw: "tags:\n front-end: false\n\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart"}
|
|
|
|
|
|
|
|
|
@ -66,7 +66,7 @@ func TestRequirementsTagsEnabledL1(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags disabling a group and enabling a different group
|
|
|
|
|
v := &chart.Config{Raw: string("tags:\n front-end: false\n\n back-end: true\n")}
|
|
|
|
|
v := &chart.Config{Raw: "tags:\n front-end: false\n\n back-end: true\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart2", "subchartb", "subchartc"}
|
|
|
|
|
|
|
|
|
@ -78,7 +78,7 @@ func TestRequirementsTagsDisabledL2(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags disabling only children
|
|
|
|
|
v := &chart.Config{Raw: string("tags:\n subcharta: false\n\n subchartb: false\n")}
|
|
|
|
|
v := &chart.Config{Raw: "tags:\n subcharta: false\n\n subchartb: false\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart1"}
|
|
|
|
|
|
|
|
|
@ -90,7 +90,7 @@ func TestRequirementsTagsDisabledL1Mixed(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags disabling all parents/children with additional tag re-enabling a parent
|
|
|
|
|
v := &chart.Config{Raw: string("tags:\n front-end: false\n\n subchart1: true\n\n back-end: false\n")}
|
|
|
|
|
v := &chart.Config{Raw: "tags:\n front-end: false\n\n subchart1: true\n\n back-end: false\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart1"}
|
|
|
|
|
|
|
|
|
@ -102,7 +102,7 @@ func TestRequirementsConditionsNonValue(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags with no effect
|
|
|
|
|
v := &chart.Config{Raw: string("subchart1:\n nothinguseful: false\n\n")}
|
|
|
|
|
v := &chart.Config{Raw: "subchart1:\n nothinguseful: false\n\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart1", "subcharta", "subchartb"}
|
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ func TestRequirementsConditionsEnabledL1Both(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// conditions enabling the parent charts, effectively enabling children
|
|
|
|
|
v := &chart.Config{Raw: string("subchart1:\n enabled: true\nsubchart2:\n enabled: true\n")}
|
|
|
|
|
v := &chart.Config{Raw: "subchart1:\n enabled: true\nsubchart2:\n enabled: true\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart1", "subchart2", "subcharta", "subchartb", "subchartb", "subchartc"}
|
|
|
|
|
|
|
|
|
@ -126,7 +126,7 @@ func TestRequirementsConditionsDisabledL1Both(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// conditions disabling the parent charts, effectively disabling children
|
|
|
|
|
v := &chart.Config{Raw: string("subchart1:\n enabled: false\nsubchart2:\n enabled: false\n")}
|
|
|
|
|
v := &chart.Config{Raw: "subchart1:\n enabled: false\nsubchart2:\n enabled: false\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart"}
|
|
|
|
|
|
|
|
|
@ -139,7 +139,7 @@ func TestRequirementsConditionsSecond(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// conditions a child using the second condition path of child's condition
|
|
|
|
|
v := &chart.Config{Raw: string("subchart1:\n subcharta:\n enabled: false\n")}
|
|
|
|
|
v := &chart.Config{Raw: "subchart1:\n subcharta:\n enabled: false\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart1", "subchartb"}
|
|
|
|
|
|
|
|
|
@ -151,7 +151,7 @@ func TestRequirementsCombinedDisabledL2(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags enabling a parent/child group with condition disabling one child
|
|
|
|
|
v := &chart.Config{Raw: string("subchartc:\n enabled: false\ntags:\n back-end: true\n")}
|
|
|
|
|
v := &chart.Config{Raw: "subchartc:\n enabled: false\ntags:\n back-end: true\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart", "subchart1", "subchart2", "subcharta", "subchartb", "subchartb"}
|
|
|
|
|
|
|
|
|
@ -163,7 +163,7 @@ func TestRequirementsCombinedDisabledL1(t *testing.T) {
|
|
|
|
|
t.Fatalf("Failed to load testdata: %s", err)
|
|
|
|
|
}
|
|
|
|
|
// tags will not enable a child if parent is explicitly disabled with condition
|
|
|
|
|
v := &chart.Config{Raw: string("subchart1:\n enabled: false\ntags:\n front-end: true\n")}
|
|
|
|
|
v := &chart.Config{Raw: "subchart1:\n enabled: false\ntags:\n front-end: true\n"}
|
|
|
|
|
// expected charts including duplicates in alphanumeric order
|
|
|
|
|
e := []string{"parentchart"}
|
|
|
|
|
|
|
|
|
|