mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 17:44:44 +00:00
Fix selection of kustomization resource from multi doc yaml
Signed-off-by: Marcus Weiner <marcus.weiner@gmail.com>
This commit is contained in:
parent
baf874ea67
commit
56b1e80758
5 changed files with 47 additions and 2 deletions
|
|
@ -189,6 +189,12 @@ func Test_unMarshallKustomization(t *testing.T) {
|
|||
wantErr: true,
|
||||
errString: "failed find kustomization with name",
|
||||
},
|
||||
{
|
||||
name: "yaml containing other resource with same name as kustomization",
|
||||
localKsFile: "testdata/local-kustomization/invalid-resource.yaml",
|
||||
wantErr: true,
|
||||
errString: "failed find kustomization with name",
|
||||
},
|
||||
}
|
||||
|
||||
b := &Builder{
|
||||
|
|
@ -324,7 +330,10 @@ func Test_ResolveKustomization(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
b := &Builder{}
|
||||
b := &Builder{
|
||||
name: "podinfo",
|
||||
namespace: "flux-system",
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
b.kustomizationFile = tt.localKsFile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue