forked from argoproj-labs/argocd-image-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add e2e tests for apps in any namespace feature (argoproj-labs#844)
Signed-off-by: Ishita Sequeira <ishiseq29@gmail.com> Signed-off-by: Tchoupinax <corentinfiloche@hotmail.fr>
- Loading branch information
1 parent
9f7a009
commit a02721b
Showing
6 changed files
with
304 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: image-updater-006 | ||
namespace: image-updater-e2e-006-01 | ||
status: | ||
health: | ||
status: Healthy | ||
sync: | ||
status: Synced |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: image-updater-e2e-006-01 | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: argocd-application-controller | ||
namespace: image-updater-e2e-006-01 # Target namespace where the app will be deployed | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods", "services", "replicationcontrollers"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
- apiGroups: ["apps"] | ||
resources: ["deployments", "daemonsets", "replicasets", "statefulsets"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
- apiGroups: ["extensions"] | ||
resources: ["ingresses"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: argocd-application-controller-binding | ||
namespace: image-updater-e2e-006-01 # Namespace where the Argo CD application is managed | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: argocd-application-controller | ||
namespace: argocd-image-updater-e2e # Namespace where the Argo CD application controller is running | ||
subjects: | ||
- kind: ServiceAccount | ||
name: argocd-application-controller | ||
namespace: argocd-image-updater-e2e # Namespace where the Argo CD application controller is running | ||
--- | ||
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: '*' | ||
--- | ||
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 | ||
namespace: image-updater-e2e-006-01 | ||
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: | ||
prune: true | ||
selfHeal: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: image-updater-006 | ||
namespace: image-updater-e2e-006-01 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 \ | ||
--loglevel trace | ||
sleep 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
timeout: 120 | ||
delete: | ||
- apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
name: image-updater-006 | ||
namespace: image-updater-e2e-006-01 | ||
- 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 | ||
- apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
name: argocd-application-controller | ||
namespace: image-updater-e2e-006-01 | ||
- apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
name: argocd-application-controller-binding | ||
namespace: image-updater-e2e-006-01 | ||
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 |
Oops, something went wrong.