Skip to content

Commit 9ba3737

Browse files
committed
fix: cleanup kustomization
1 parent 2a71784 commit 9ba3737

File tree

2 files changed

+35
-28
lines changed

2 files changed

+35
-28
lines changed

pkg/kustomize.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,6 @@ import (
1717
"sigs.k8s.io/kustomize/kyaml/filesys"
1818
)
1919

20-
func GetKubernetesManifests(argoApplication argo.Application) ([]k8s.Object, error) {
21-
var objects []k8s.Object
22-
var err error
23-
24-
if argoApplication.Spec.Source != nil && argoApplication.Spec.Source.Path != "" {
25-
objects, err = prepareKubernetesManifests(*argoApplication.Spec.Source)
26-
if err != nil {
27-
return nil, err
28-
}
29-
30-
return objects, nil
31-
}
32-
33-
var source argo.ApplicationSource
34-
for _, source = range argoApplication.Spec.Sources {
35-
if source.Path == "" {
36-
continue
37-
}
38-
39-
objects, err = prepareKubernetesManifests(source)
40-
if err != nil {
41-
return nil, err
42-
}
43-
}
44-
45-
return objects, nil
46-
}
47-
4820
func prepareKubernetesManifests(applicationSource argo.ApplicationSource) ([]k8s.Object, error) {
4921
realPath := os.DirFS("../" + applicationSource.Path)
5022

pkg/manifest.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package e2eutils
2+
3+
import (
4+
"e2eutils/pkg/argo"
5+
6+
"sigs.k8s.io/e2e-framework/klient/k8s"
7+
)
8+
9+
func GetKubernetesManifests(argoApplication argo.Application) ([]k8s.Object, error) {
10+
var objects []k8s.Object
11+
var err error
12+
13+
if argoApplication.Spec.Source != nil && argoApplication.Spec.Source.Path != "" {
14+
objects, err = prepareKubernetesManifests(*argoApplication.Spec.Source)
15+
if err != nil {
16+
return nil, err
17+
}
18+
19+
return objects, nil
20+
}
21+
22+
var source argo.ApplicationSource
23+
for _, source = range argoApplication.Spec.Sources {
24+
if source.Path == "" {
25+
continue
26+
}
27+
28+
objects, err = prepareKubernetesManifests(source)
29+
if err != nil {
30+
return nil, err
31+
}
32+
}
33+
34+
return objects, nil
35+
}

0 commit comments

Comments
 (0)