Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e tests for apps in any namespace feature #844

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions test/e2e/suite/006-apps-in-any-namespace/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
argocd-image-updater.argoproj.io/image-list: guestbook=gcr.io/heptio-images/ks-guestbook-demo:~0
argocd-image-updater.argoproj.io/guestbook.update-strategy: semver
name: image-updater-006
spec:
project: project-one
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
path: kustomize-guestbook
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: image-updater-e2e-006-01
syncPolicy:
automated: {}
retry:
limit: 2
status:
health:
status: Healthy
sync:
status: Synced
63 changes: 63 additions & 0 deletions test/e2e/suite/006-apps-in-any-namespace/01-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: v1
kind: Namespace
metadata:
name: image-updater-e2e-006
---
apiVersion: v1
kind: Namespace
metadata:
name: image-updater-e2e-006-01
---
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cmd-params-cm
namespace: argocd-image-updater-e2e
labels:
app.kubernetes.io/name: argocd-cmd-params-cm
app.kubernetes.io/part-of: argocd
data:
application.namespaces: image-updater-e2e-006-01
---
kind: AppProject
apiVersion: argoproj.io/v1alpha1
metadata:
name: project-one
namespace: argocd-image-updater-e2e
spec:
sourceRepos:
- '*'
destinations:
- namespace: '*'
server: '*'
sourceNamespaces:
- image-updater-e2e-006-01
---
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
kubectl rollout restart -n argocd-image-updater-e2e deployment argocd-server
kubectl rollout restart -n argocd-image-updater-e2e statefulset argocd-application-controller
sleep 30
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: image-updater-006
ishitasequeira marked this conversation as resolved.
Show resolved Hide resolved
annotations:
argocd-image-updater.argoproj.io/image-list: guestbook=gcr.io/heptio-images/ks-guestbook-demo:~0
argocd-image-updater.argoproj.io/guestbook.update-strategy: semver
spec:
project: project-one
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
path: kustomize-guestbook
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: image-updater-e2e-006-01
syncPolicy:
automated: {}
retry:
limit: 2
22 changes: 22 additions & 0 deletions test/e2e/suite/006-apps-in-any-namespace/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: image-updater-006
spec:
source:
kustomize:
images:
- gcr.io/heptio-images/ks-guestbook-demo:0.2
status:
health:
status: Healthy
sync:
status: Synced
---
apiVersion: v1
kind: Pod
metadata:
namespace: image-updater-e2e-006-01
spec:
containers:
- image: gcr.io/heptio-images/ks-guestbook-demo:0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
${SRC_DIR}/dist/argocd-image-updater run --once \
--argocd-namespace argocd-image-updater-e2e \
--loglevel trace
21 changes: 21 additions & 0 deletions test/e2e/suite/006-apps-in-any-namespace/99-delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
timeout: 120
delete:
- apiVersion: argoproj.io/v1alpha1
kind: Application
name: image-updater-006
- apiVersion: argoproj.io/v1alpha1
kind: AppProject
name: project-one
- apiVersion: v1
kind: Namespace
name: image-updater-e2e-006-01
- apiVersion: v1
kind: Namespace
name: image-updater-e2e-006
script: |
kubectl patch configmap argocd-cmd-params-cm -n argocd-image-updater-e2e --type=json -p='[{"op": "remove", "path": "/data/application.namespaces"}]'
kubectl rollout restart -n argocd-image-updater-e2e deployment argocd-server
kubectl rollout restart -n argocd-image-updater-e2e statefulset argocd-application-controller
sleep 30
Loading