4848 run : |
4949 kubectl create ns ${{ env.NAMESPACE1 }}
5050 kubectl create ns ${{ env.NAMESPACE2 }}
51+ kubectl create ns test-namespace
5152
5253 - uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
5354 name : Install Python
@@ -56,44 +57,44 @@ jobs:
5657
5758 - name : Cleaning any previously created items
5859 run : |
59- python test/integration/k8s-deploy-delete.py 'Deployment' 'all' ${{ env.NAMESPACE1 }}
60- python test/integration/k8s-deploy-delete.py 'Deployment' 'all' ${{ env.NAMESPACE2 }}
60+ python test/integration/k8s-deploy-delete.py 'Deployment' 'all' ${{ env.NAMESPACE1 }}
61+ python test/integration/k8s-deploy-delete.py 'Deployment' 'all' ${{ env.NAMESPACE2 }}
6162 - name : Create test manifests
6263 run : |
63- echo "Creating test manifests..."
64- cat <<EOF > test_with_ns.yaml
65- apiVersion: apps/v1
66- kind: Deployment
67- metadata:
68- name: test-deployment
69- namespace: ${{ env.NAMESPACE1 }}
70- spec:
71- replicas: 1
72- selector:
73- matchLabels:
74- app: test-app
75- template:
76- metadata:
77- labels:
78- app: test-app
79- spec:
80- containers:
81- - name: test-container
82- image: nginx:latest
83- ports:
84- - containerPort: 80
64+ echo "Creating test manifests..."
65+ cat <<EOF > test_with_ns.yaml
66+ apiVersion: apps/v1
67+ kind: Deployment
68+ metadata:
69+ name: test-deployment
70+ namespace: ${{ env.NAMESPACE1 }}
71+ spec:
72+ replicas: 1
73+ selector:
74+ matchLabels:
75+ app: test-app
76+ template:
77+ metadata:
78+ labels:
79+ app: test-app
80+ spec:
81+ containers:
82+ - name: test-container
83+ image: nginx:latest
84+ ports:
85+ - containerPort: 80
8586 - name : Test - Handles namespace correctly based on manifest
8687 uses : ./
8788 with :
8889 images : nginx:1.14.2
8990 manifests : |
90- test_with_ns.yaml
91+ test/integration/manifests/ test_with_ns.yaml
9192 test/integration/manifests/test_no_ns.yaml
9293 action : deploy
9394
9495 - name : Verify deployment in namespace1
9596 run : |
96- python test/integration/k8s-deploy-test.py namespace=${{ env.NAMESPACE1 }} kind=Deployment name=test-deployment containerName=nginx:1.14.2 labels=app:test-app selectorLabels=app:test-app
97+ python test/integration/k8s-deploy-test.py namespace=test-namespace kind=Deployment name=test-deployment containerName=nginx:1.14.2 labels=app:test-app selectorLabels=app:test-app
9798
9899 - name : Verify deployment in default namespace
99100 run : |
@@ -102,7 +103,7 @@ jobs:
102103 - name : Test - Deploys the same resource to two different namespaces without conflict
103104 uses : ./
104105 with :
105- namespace : ${{ env.NAMESPACE1 }},${{ env.NAMESPACE2 }}
106+ namespace : ${{ env.NAMESPACE1 }},${{ env.NAMESPACE2 }}
106107 images : nginx:1.14.2
107108 manifests : |
108109 test/integration/manifests/test_no_ns.yaml
@@ -123,5 +124,4 @@ jobs:
123124
124125 kubectl delete ns ${{ env.NAMESPACE1 }}
125126 kubectl delete ns ${{ env.NAMESPACE2 }}
126- rm -rf test_with_ns.yaml
127-
127+ rm -rf test_with_ns.yaml test_no_ns.yaml
0 commit comments