@ -99,18 +99,22 @@ func TestDependencyEnabled(t *testing.T) {
[ ] string { "parentchart" , "parentchart.subchart1" , "parentchart.subchart1.subchartb" } ,
} , {
"tags enabling a parent/child group with condition disabling one child" ,
M { "subchart c": M { "enabled" : false } , "tags" : M { "back-end" : true } } ,
M { "subchart 2": M { "subchart c": M { "enabled" : false } } , "tags" : M { "back-end" : true } } ,
[ ] string { "parentchart" , "parentchart.subchart1" , "parentchart.subchart1.subcharta" , "parentchart.subchart1.subchartb" , "parentchart.subchart2" , "parentchart.subchart2.subchartb" } ,
} , {
"tags will not enable a child if parent is explicitly disabled with condition" ,
M { "subchart1" : M { "enabled" : false } , "tags" : M { "front-end" : true } } ,
[ ] string { "parentchart" } ,
} , {
"subcharts with alias also respect conditions" ,
M { "subchart1" : M { "enabled" : false } , "subchart2alias" : M { "enabled" : true , "subchartb" : M { "enabled" : true } } } ,
[ ] string { "parentchart" , "parentchart.subchart2alias" , "parentchart.subchart2alias.subchartb" } ,
} }
for _ , tc := range tests {
c := loadChart ( t , "testdata/subpop" )
t . Run ( tc . name , func ( t * testing . T ) {
if err := processDependencyEnabled ( c , tc . v ); err != nil {
if err := processDependencyEnabled ( c , tc . v , "" ); err != nil {
t . Fatalf ( "error processing enabled dependencies %v" , err )
}
@ -279,7 +283,7 @@ func TestDependentChartAliases(t *testing.T) {
t . Fatalf ( "expected 2 dependencies for this chart, but got %d" , len ( c . Dependencies ( ) ) )
}
if err := processDependencyEnabled ( c , c . Values ); err != nil {
if err := processDependencyEnabled ( c , c . Values , "" ); err != nil {
t . Fatalf ( "expected no errors but got %q" , err )
}
@ -300,7 +304,7 @@ func TestDependentChartWithSubChartsAbsentInDependency(t *testing.T) {
t . Fatalf ( "expected 2 dependencies for this chart, but got %d" , len ( c . Dependencies ( ) ) )
}
if err := processDependencyEnabled ( c , c . Values ); err != nil {
if err := processDependencyEnabled ( c , c . Values , "" ); err != nil {
t . Fatalf ( "expected no errors but got %q" , err )
}
@ -332,7 +336,7 @@ func TestDependentChartsWithSubchartsAllSpecifiedInDependency(t *testing.T) {
t . Fatalf ( "expected 2 dependencies for this chart, but got %d" , len ( c . Dependencies ( ) ) )
}
if err := processDependencyEnabled ( c , c . Values ); err != nil {
if err := processDependencyEnabled ( c , c . Values , "" ); err != nil {
t . Fatalf ( "expected no errors but got %q" , err )
}
@ -352,7 +356,7 @@ func TestDependentChartsWithSomeSubchartsSpecifiedInDependency(t *testing.T) {
t . Fatalf ( "expected 2 dependencies for this chart, but got %d" , len ( c . Dependencies ( ) ) )
}
if err := processDependencyEnabled ( c , c . Values ); err != nil {
if err := processDependencyEnabled ( c , c . Values , "" ); err != nil {
t . Fatalf ( "expected no errors but got %q" , err )
}