@ -62,7 +62,8 @@ metadata:
annotations :
annotations :
"helm.sh/hook" : post - install
"helm.sh/hook" : post - install
` ,
` ,
} , {
} ,
{
name : [ ] string { "third" } ,
name : [ ] string { "third" } ,
path : "three" ,
path : "three" ,
kind : [ ] string { "ReplicaSet" } ,
kind : [ ] string { "ReplicaSet" } ,
@ -74,7 +75,8 @@ metadata:
annotations :
annotations :
"helm.sh/hook" : no - such - hook
"helm.sh/hook" : no - such - hook
` ,
` ,
} , {
} ,
{
name : [ ] string { "fourth" } ,
name : [ ] string { "fourth" } ,
path : "four" ,
path : "four" ,
kind : [ ] string { "Pod" } ,
kind : [ ] string { "Pod" } ,
@ -85,7 +87,8 @@ metadata:
name : fourth
name : fourth
annotations :
annotations :
nothing : here ` ,
nothing : here ` ,
} , {
} ,
{
name : [ ] string { "fifth" } ,
name : [ ] string { "fifth" } ,
path : "five" ,
path : "five" ,
kind : [ ] string { "ReplicaSet" } ,
kind : [ ] string { "ReplicaSet" } ,
@ -97,14 +100,16 @@ metadata:
annotations :
annotations :
"helm.sh/hook" : post - delete , post - install
"helm.sh/hook" : post - delete , post - install
` ,
` ,
} , {
} ,
{
// Regression test: files with an underscore in the base name should be skipped.
// Regression test: files with an underscore in the base name should be skipped.
name : [ ] string { "sixth" } ,
name : [ ] string { "sixth" } ,
path : "six/_six" ,
path : "six/_six" ,
kind : [ ] string { "ReplicaSet" } ,
kind : [ ] string { "ReplicaSet" } ,
hooks : map [ string ] [ ] release . HookEvent { "sixth" : nil } ,
hooks : map [ string ] [ ] release . HookEvent { "sixth" : nil } ,
manifest : ` invalid manifest ` , // This will fail if partial is not skipped.
manifest : ` invalid manifest ` , // This will fail if partial is not skipped.
} , {
} ,
{
// Regression test: files with no content should be skipped.
// Regression test: files with no content should be skipped.
name : [ ] string { "seventh" } ,
name : [ ] string { "seventh" } ,
path : "seven" ,
path : "seven" ,
@ -130,6 +135,19 @@ metadata:
name : example - test
name : example - test
annotations :
annotations :
"helm.sh/hook" : test
"helm.sh/hook" : test
` ,
} ,
{
name : [ ] string { "ninth" } ,
path : "nine" ,
kind : [ ] string { "ReplicaSet" } ,
hooks : map [ string ] [ ] release . HookEvent { "ninth" : { release . HookPreReady } } ,
manifest : ` kind : ReplicaSet
apiVersion : v1beta1
metadata :
name : ninth
annotations :
"helm.sh/hook" : pre - ready
` ,
` ,
} ,
} ,
}
}
@ -149,8 +167,8 @@ metadata:
t . Errorf ( "Expected 2 generic manifests, got %d" , len ( generic ) )
t . Errorf ( "Expected 2 generic manifests, got %d" , len ( generic ) )
}
}
if len ( hs ) != 4 {
if len ( hs ) != 5 {
t . Errorf ( "Expected 4 hooks, got %d", len ( hs ) )
t . Errorf ( "Expected 5 hooks, got %d", len ( hs ) )
}
}
for _ , out := range hs {
for _ , out := range hs {