summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjannfis <jann@mistrust.net>2022-02-23 08:21:51 +0100
committerGitHub <noreply@github.com>2022-02-23 08:21:51 +0100
commit65307025d2e282815764f2e316edb70542504802 (patch)
tree8561a1e36ea75fefd8287ef6b6acde7fccd39e30 /test
parent474a5762d0fb7bbb7ed4c68f9578b6fab7552842 (diff)
test: Add e2e test for multiple images (#383)
Signed-off-by: jannfis <jann@mistrust.net>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/containers/git/testdata/004-multi-images/deployment.yaml22
-rw-r--r--test/e2e/containers/git/testdata/004-multi-images/kustomization.yaml2
-rw-r--r--test/e2e/suite/004-multiple-images/01-assert.yaml9
-rw-r--r--test/e2e/suite/004-multiple-images/01-install.yaml27
-rw-r--r--test/e2e/suite/004-multiple-images/02-assert.yaml24
-rw-r--r--test/e2e/suite/004-multiple-images/02-run-updater.yaml8
-rw-r--r--test/e2e/suite/004-multiple-images/99-delete.yaml10
-rw-r--r--test/e2e/testdata/004-multi-images/deployment.yaml22
-rw-r--r--test/e2e/testdata/004-multi-images/kustomization.yaml2
9 files changed, 126 insertions, 0 deletions
diff --git a/test/e2e/containers/git/testdata/004-multi-images/deployment.yaml b/test/e2e/containers/git/testdata/004-multi-images/deployment.yaml
new file mode 100644
index 0000000..a77bbc1
--- /dev/null
+++ b/test/e2e/containers/git/testdata/004-multi-images/deployment.yaml
@@ -0,0 +1,22 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: e2e-registry
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: test-app-001
+ component: argocd-image-updater-e2e
+ template:
+ metadata:
+ labels:
+ app: test-app-001
+ component: argocd-image-updater-e2e
+ spec:
+ containers:
+ - name: test1
+ image: 10.42.0.1:30000/test-image:1.0.0
+ - name: test2
+ image: 10.42.0.1:30000/other-image:1.0.0
+
diff --git a/test/e2e/containers/git/testdata/004-multi-images/kustomization.yaml b/test/e2e/containers/git/testdata/004-multi-images/kustomization.yaml
new file mode 100644
index 0000000..9519a26
--- /dev/null
+++ b/test/e2e/containers/git/testdata/004-multi-images/kustomization.yaml
@@ -0,0 +1,2 @@
+resources:
+ - deployment.yaml
diff --git a/test/e2e/suite/004-multiple-images/01-assert.yaml b/test/e2e/suite/004-multiple-images/01-assert.yaml
new file mode 100644
index 0000000..9cdd8ad
--- /dev/null
+++ b/test/e2e/suite/004-multiple-images/01-assert.yaml
@@ -0,0 +1,9 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-004
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced
diff --git a/test/e2e/suite/004-multiple-images/01-install.yaml b/test/e2e/suite/004-multiple-images/01-install.yaml
new file mode 100644
index 0000000..76e6f2e
--- /dev/null
+++ b/test/e2e/suite/004-multiple-images/01-install.yaml
@@ -0,0 +1,27 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: image-updater-e2e-004
+---
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-004
+ annotations:
+ argocd-image-updater.argoproj.io/image-list: test1=10.42.0.1:30000/test-image:1.X.X,test2=10.42.0.1:30000/other-image:1.X.X
+ argocd-image-updater.argoproj.io/test.update-strategy: semver
+ finalizers:
+ - resources-finalizer.argocd.argoproj.io
+spec:
+ project: default
+ source:
+ repoURL: http://10.42.0.1:30002/testdata.git
+ path: ./004-multi-images
+ targetRevision: HEAD
+ destination:
+ server: https://kubernetes.default.svc
+ namespace: image-updater-e2e-004
+ syncPolicy:
+ automated: {}
+ retry:
+ limit: 2
diff --git a/test/e2e/suite/004-multiple-images/02-assert.yaml b/test/e2e/suite/004-multiple-images/02-assert.yaml
new file mode 100644
index 0000000..04aaa46
--- /dev/null
+++ b/test/e2e/suite/004-multiple-images/02-assert.yaml
@@ -0,0 +1,24 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-004
+spec:
+ source:
+ kustomize:
+ images:
+ - 10.42.0.1:30000/test-image:1.0.2
+ - 10.42.0.1:30000/other-image:1.0.1
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced
+---
+apiVersion: v1
+kind: Pod
+metadata:
+ namespace: image-updater-e2e-004
+spec:
+ containers:
+ - image: 10.42.0.1:30000/test-image:1.0.2
+ - image: 10.42.0.1:30000/other-image:1.0.1
diff --git a/test/e2e/suite/004-multiple-images/02-run-updater.yaml b/test/e2e/suite/004-multiple-images/02-run-updater.yaml
new file mode 100644
index 0000000..db51f3f
--- /dev/null
+++ b/test/e2e/suite/004-multiple-images/02-run-updater.yaml
@@ -0,0 +1,8 @@
+apiVersion: kuttl.dev/v1beta1
+kind: TestStep
+commands:
+- script: |
+ ${SRC_DIR}/dist/argocd-image-updater run --once \
+ --argocd-namespace argocd-image-updater-e2e \
+ --registries-conf-path ${SRC_DIR}/test/e2e/assets/registries.conf \
+ --loglevel trace \ No newline at end of file
diff --git a/test/e2e/suite/004-multiple-images/99-delete.yaml b/test/e2e/suite/004-multiple-images/99-delete.yaml
new file mode 100644
index 0000000..8630d0a
--- /dev/null
+++ b/test/e2e/suite/004-multiple-images/99-delete.yaml
@@ -0,0 +1,10 @@
+apiVersion: kuttl.dev/v1beta1
+kind: TestStep
+timeout: 120
+delete:
+- apiVersion: argoproj.io/v1alpha1
+ kind: Application
+ name: image-updater-004
+- apiVersion: v1
+ kind: Namespace
+ name: image-updater-e2e-004
diff --git a/test/e2e/testdata/004-multi-images/deployment.yaml b/test/e2e/testdata/004-multi-images/deployment.yaml
new file mode 100644
index 0000000..a77bbc1
--- /dev/null
+++ b/test/e2e/testdata/004-multi-images/deployment.yaml
@@ -0,0 +1,22 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: e2e-registry
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: test-app-001
+ component: argocd-image-updater-e2e
+ template:
+ metadata:
+ labels:
+ app: test-app-001
+ component: argocd-image-updater-e2e
+ spec:
+ containers:
+ - name: test1
+ image: 10.42.0.1:30000/test-image:1.0.0
+ - name: test2
+ image: 10.42.0.1:30000/other-image:1.0.0
+
diff --git a/test/e2e/testdata/004-multi-images/kustomization.yaml b/test/e2e/testdata/004-multi-images/kustomization.yaml
new file mode 100644
index 0000000..9519a26
--- /dev/null
+++ b/test/e2e/testdata/004-multi-images/kustomization.yaml
@@ -0,0 +1,2 @@
+resources:
+ - deployment.yaml