Skip to content

Commit

Permalink
fix: Unit test ListApps can now discover plain K8s manifests (#8949)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashin Sabu <[email protected]>
  • Loading branch information
ashinsabu3 committed Sep 4, 2023
1 parent ba8d3d8 commit 404f5a2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
27 changes: 27 additions & 0 deletions test/cmp/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
name: cmp-plugin
spec:
version: v1.0
init:
command: [env]
generate:
command: [sh, -c, 'kustomize build']
discover:
find:
glob: "**/kustomization.yaml"
parameters:
static:
- name: string-param
string: value
- name: array-param
collectionType: array
array:
- value1
- value2
- name: map-param
collectionType: map
map:
key: value
key2: value2
6 changes: 4 additions & 2 deletions util/app/discovery/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ func TestDiscover(t *testing.T) {
apps, err := Discover(context.Background(), "./testdata", "./testdata", map[string]bool{}, []string{})
assert.NoError(t, err)
assert.Equal(t, map[string]string{
"foo": "Kustomize",
"baz": "Helm",
"foo": "Kustomize",
"baz": "Helm",
"foo2": "Directory",
"baz2": "Directory",
}, apps)
}

Expand Down
1 change: 1 addition & 0 deletions util/app/discovery/testdata/baz2/depl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kind: Deployment
1 change: 1 addition & 0 deletions util/app/discovery/testdata/foo2/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kind: Service

0 comments on commit 404f5a2

Please sign in to comment.