File tree Expand file tree Collapse file tree 2 files changed +35
-28
lines changed Expand file tree Collapse file tree 2 files changed +35
-28
lines changed Original file line number Diff line number Diff 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-
4820func prepareKubernetesManifests (applicationSource argo.ApplicationSource ) ([]k8s.Object , error ) {
4921 realPath := os .DirFS ("../" + applicationSource .Path )
5022
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments