summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjannfis <jann@mistrust.net>2022-01-19 16:28:47 +0100
committerGitHub <noreply@github.com>2022-01-19 16:28:47 +0100
commit7ed1f675ca2373dd8f0442e1a398e3fc9a227c55 (patch)
tree50df8fc40c2ae857b46145e22e27cba78172a3b8 /test
parent62a43ea56d18987ba1fda00ebc161609204f312a (diff)
chore: Add initial e2e test infrastructure (#358)
* This is a first throw at integrating an e2e suite Signed-off-by: jannfis <jann@mistrust.net> * Exclude test suite from spellcheck Signed-off-by: jannfis <jann@mistrust.net>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/Makefile26
-rw-r--r--test/e2e/README.md47
-rw-r--r--test/e2e/assets/Procfile2
-rw-r--r--test/e2e/assets/daemon.json3
-rwxr-xr-xtest/e2e/assets/entrypoint.sh12
-rw-r--r--test/e2e/assets/nginx.conf29
-rw-r--r--test/e2e/assets/registries.conf6
-rw-r--r--test/e2e/assets/registries.yaml5
-rw-r--r--test/e2e/assets/registry.crt33
-rw-r--r--test/e2e/assets/registry.key52
-rwxr-xr-xtest/e2e/bin/install.sh15
-rw-r--r--test/e2e/containers/git/Dockerfile22
-rw-r--r--test/e2e/containers/git/LICENSE22
-rw-r--r--test/e2e/containers/git/README.md81
-rwxr-xr-xtest/e2e/containers/git/entrypoint.sh83
-rw-r--r--test/e2e/containers/git/etc/nginx/htpasswd1
-rw-r--r--test/e2e/containers/git/etc/nginx/localhost.crt30
-rw-r--r--test/e2e/containers/git/etc/nginx/localhost.key52
-rw-r--r--test/e2e/containers/git/etc/nginx/nginx.conf29
-rw-r--r--test/e2e/containers/git/etc/nginx/sites-enabled/git-http-auth36
-rw-r--r--test/e2e/containers/git/etc/nginx/sites-enabled/git-http-noauth29
-rw-r--r--test/e2e/containers/git/example/docker-compose.no-init.yml8
-rw-r--r--test/e2e/containers/git/example/docker-compose.yml11
-rw-r--r--test/e2e/containers/git/example/initial/myrepo/myfile.txt0
-rw-r--r--test/e2e/containers/git/example/initial/myrepo2/myfile2.txt0
-rwxr-xr-xtest/e2e/containers/git/test.sh37
-rw-r--r--test/e2e/containers/git/testdata/001-simple-kustomize-app/deployment.yaml20
-rw-r--r--test/e2e/containers/git/testdata/001-simple-kustomize-app/kustomization.yaml2
-rw-r--r--test/e2e/containers/git/testdata/001/deployment.yaml20
-rw-r--r--test/e2e/containers/git/testdata/001/kustomization.yaml2
-rwxr-xr-xtest/e2e/e2e-test.sh62
-rw-r--r--test/e2e/images/Makefile15
-rw-r--r--test/e2e/images/test-image/Dockerfile5
-rwxr-xr-xtest/e2e/images/test-image/entrypoint.sh3
-rw-r--r--test/e2e/kuttl-test.yaml11
-rw-r--r--test/e2e/prereqs/argocd/clusterrolebinding.json7
-rw-r--r--test/e2e/prereqs/argocd/kustomization.yaml11
-rw-r--r--test/e2e/prereqs/argocd/repository.yaml14
-rw-r--r--test/e2e/prereqs/registry/registry.yaml333
-rw-r--r--test/e2e/prereqs/repo/install.yaml43
-rw-r--r--test/e2e/suite/001-simple-kustomize-app-semver/01-assert.yaml9
-rw-r--r--test/e2e/suite/001-simple-kustomize-app-semver/01-install.yaml27
-rw-r--r--test/e2e/suite/001-simple-kustomize-app-semver/02-assert.yaml22
-rw-r--r--test/e2e/suite/001-simple-kustomize-app-semver/02-run-updater.yaml8
-rw-r--r--test/e2e/suite/001-simple-kustomize-app-semver/99-delete.yaml10
-rw-r--r--test/e2e/suite/002-simple-kustomize-app-latest/00-build.yaml7
-rw-r--r--test/e2e/suite/002-simple-kustomize-app-latest/01-assert.yaml9
-rw-r--r--test/e2e/suite/002-simple-kustomize-app-latest/01-install.yaml28
-rw-r--r--test/e2e/suite/002-simple-kustomize-app-latest/02-assert.yaml17
-rw-r--r--test/e2e/suite/002-simple-kustomize-app-latest/02-run-updater.yaml14
-rw-r--r--test/e2e/suite/002-simple-kustomize-app-latest/99-delete.yaml10
-rw-r--r--test/e2e/suite/003-invalid-image-specified/01-assert.yaml9
-rw-r--r--test/e2e/suite/003-invalid-image-specified/01-install.yaml27
-rw-r--r--test/e2e/suite/003-invalid-image-specified/02-assert.yaml17
-rw-r--r--test/e2e/suite/003-invalid-image-specified/02-run-updater.yaml14
-rw-r--r--test/e2e/suite/003-invalid-image-specified/99-delete.yaml10
-rw-r--r--test/e2e/testdata/001-simple-kustomize-app/deployment.yaml20
-rw-r--r--test/e2e/testdata/001-simple-kustomize-app/kustomization.yaml2
58 files changed, 1479 insertions, 0 deletions
diff --git a/test/e2e/Makefile b/test/e2e/Makefile
new file mode 100644
index 0000000..5c7dd07
--- /dev/null
+++ b/test/e2e/Makefile
@@ -0,0 +1,26 @@
+IMAGE_REPO ?= 10.42.0.1:30000
+IMAGE_NAME ?= git-http
+IMAGE_TAG ?= latest
+
+IMAGE_SLUG := $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
+
+git-container-build: copy-testdata
+ docker build -t $(IMAGE_SLUG) -f ./containers/git/Dockerfile ./containers/git
+
+git-container-push: git-container-build
+ docker push $(IMAGE_SLUG)
+
+copy-testdata:
+ cp -r testdata containers/git
+
+install-prereqs:
+ kustomize build prereqs/argocd | kubectl -n argocd-image-updater-e2e apply -f -
+ kubectl apply -n argocd-image-updater-e2e -f prereqs/registry/registry.yaml
+ kubectl rollout -n argocd-image-updater-e2e status deployment e2e-registry-public
+ sleep 5
+ make git-container-push
+ kubectl apply -n argocd-image-updater-e2e -f prereqs/repo/install.yaml
+
+.PHONY: git-container-build
+.PHONY: git-container-push
+.PHONY: copy-testdata
diff --git a/test/e2e/README.md b/test/e2e/README.md
new file mode 100644
index 0000000..25ff469
--- /dev/null
+++ b/test/e2e/README.md
@@ -0,0 +1,47 @@
+# End-to-end tests
+
+This directory contains the end-to-end tests for Argo CD Image Updater. The
+tests are implemented using [kuttl](https://kuttl.dev) and require some
+prerequisites.
+
+**This is work-in-progress at a very early stage**. The end-to-end tests are
+not yet expected to work flawlessly, and they require an opinionated setup to
+run. If you are going to use the end-to-end tests, it is expected that you are
+prepared to hack on them. Do not ask for support, please.
+
+# Components
+
+The end-to-end tests are comprised of the following components:
+
+* A local, vanilla K8s cluster that is treated as volatile. The tests only
+ support k3s as a cluster at the moment.
+* A dedicated Argo CD installation. No other Argo CD must be installed to
+ the test cluster.
+* A Git repository, containing resources to be consumed by Argo CD.
+ This will be deployed on demand to the test cluster, with test data that
+ is provided by the end-to-end tests.
+* A Docker registry, holding the container images we use for testing.
+ This will be deployed on demand to the test cluster.
+
+## Local cluster
+
+### Cluster installation
+
+1. Install a recent version of [k3s](https://k3s.io/) on your local machine.
+ If you want to re-use your k3s cluster, be aware that the test suite needs
+ changes to the cluster's configuration, i.e. it will set up a custom
+ container registry and credentials.
+
+2. Run `./bin/install.sh`. This will
+
+ * Configure your Docker daemon to be able to push to the test registry in
+ an insecure manner.
+
+ * Configure K3s to be able to access the test registry
+
+3. Create required namespace in the cluster: `kubectl create ns argocd-image-updater-e2e`
+
+## Pre-requisites
+
+1. Run `make install-prereqs` to install all the pre-requisites on your local
+ cluster.
diff --git a/test/e2e/assets/Procfile b/test/e2e/assets/Procfile
new file mode 100644
index 0000000..4ba7eb5
--- /dev/null
+++ b/test/e2e/assets/Procfile
@@ -0,0 +1,2 @@
+fcgiwrap: sudo sh -c "(rm -f /var/run/fcgiwrap.socket && fcgiwrap -s unix:/var/run/fcgiwrap.socket & sleep 1 && chmod 777 /var/run/fcgiwrap.socket && wait)"
+nginx: sudo sh -c "nginx -g 'daemon off;' -c /etc/nginx/nginx.conf"
diff --git a/test/e2e/assets/daemon.json b/test/e2e/assets/daemon.json
new file mode 100644
index 0000000..518dd42
--- /dev/null
+++ b/test/e2e/assets/daemon.json
@@ -0,0 +1,3 @@
+{
+ "insecure-registries" : ["10.42.0.1:30000"]
+}
diff --git a/test/e2e/assets/entrypoint.sh b/test/e2e/assets/entrypoint.sh
new file mode 100755
index 0000000..ad2a348
--- /dev/null
+++ b/test/e2e/assets/entrypoint.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -e
+
+if test "$(id -u)" == "0" -a "${USER_ID}" != ""; then
+ useradd -u ${USER_ID} -d /home/user -s /bin/bash ${USER_NAME:-default}
+ chown -R "${USER_NAME:-default}" ${GOCACHE}
+fi
+
+export PATH=$PATH:/usr/local/go/bin:/go/bin
+export GOROOT=/usr/local/go
+
+"$@" \ No newline at end of file
diff --git a/test/e2e/assets/nginx.conf b/test/e2e/assets/nginx.conf
new file mode 100644
index 0000000..2a161af
--- /dev/null
+++ b/test/e2e/assets/nginx.conf
@@ -0,0 +1,29 @@
+error_log /dev/stdout info;
+worker_processes 1;
+
+events { worker_connections 1024; }
+
+http {
+
+ server {
+ listen 0.0.0.0:8080;
+
+ root /tmp/testdata.git;
+
+ location ~ /argocd-image-updater-e2e(/.*) {
+ # Set chunks to unlimited, as the body's can be huge
+ client_max_body_size 0;
+
+ fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param GIT_HTTP_EXPORT_ALL "";
+ fastcgi_param GIT_PROJECT_ROOT /tmp;
+ fastcgi_param PATH_INFO $1;
+
+ # Hard-coded credentials for Git in this case
+ fastcgi_param REMOTE_USER "admin";
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ }
+ }
+
+}
diff --git a/test/e2e/assets/registries.conf b/test/e2e/assets/registries.conf
new file mode 100644
index 0000000..27bc5ed
--- /dev/null
+++ b/test/e2e/assets/registries.conf
@@ -0,0 +1,6 @@
+registries:
+- name: Test Registry
+ api_url: https://10.42.0.1:30000
+ ping: yes
+ prefix: 10.42.0.1:30000
+ insecure: true \ No newline at end of file
diff --git a/test/e2e/assets/registries.yaml b/test/e2e/assets/registries.yaml
new file mode 100644
index 0000000..156b403
--- /dev/null
+++ b/test/e2e/assets/registries.yaml
@@ -0,0 +1,5 @@
+configs:
+ "10.42.0.1:30000":
+ tls:
+ ca_file: /etc/rancher/k3s/local.crt
+ insecure_skip_verify: true
diff --git a/test/e2e/assets/registry.crt b/test/e2e/assets/registry.crt
new file mode 100644
index 0000000..9b8be4a
--- /dev/null
+++ b/test/e2e/assets/registry.crt
@@ -0,0 +1,33 @@
+-----BEGIN CERTIFICATE-----
+MIIFpDCCA4ygAwIBAgIUAsEthF+di48FNSBsjeTHyNb5ojYwDQYJKoZIhvcNAQEL
+BQAwWTELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UE
+CgwTRGVmYXVsdCBDb21wYW55IEx0ZDEVMBMGA1UEAwwMZTJlLXJlZ2lzdHJ5MB4X
+DTIxMTAwODExNTQxNloXDTIyMTAwODExNTQxNlowWTELMAkGA1UEBhMCWFgxFTAT
+BgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0
+ZDEVMBMGA1UEAwwMZTJlLXJlZ2lzdHJ5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
+MIICCgKCAgEA6sIOAHpasH3UxwJJvyIJc144u52QsenJ6eZM7XShwPSQURkiubks
++OwiCFQVKJGn80cdDzMdhaPQSXZzJETC7/cHFFndQrpRe6E2OJu3AZZVD0b+c4hB
+KPLZiWrtQtThlV+YjJ69YdMCGR4+Ph0gwptm4XNUzIXTFmVsjmi2oja6hpN0P8NB
+6np9u7ckJIaj38RbIBRm5KDnvOVbvxapXJHotpmLiGF8GEG4H0/Sw1g8vsanU8dV
+nidtHqx2+JnC6FEo9ATThbse9zBwzHIaAgoeracATVXLbWK4Todsxe9NAtMZ80DQ
+1W78EN/7vrHUDFMNXxP0itL5ZoVu8DGhpjmvZWt5vwES5kfZPKbBJ2zBewBxl26f
+NruDY5dQAvbXee4I2Lihny3nLL131qqVrlL2DUv+FNvuDgFp+O15XYtTrIlYrWrj
+9seQ/6PuXASs1JddadZwGBkNni+jjSkcnuSYqMRop7/diPxGXj+sEv/FDoA2sGwB
+uJsp5D5+Fd5a+DzVHUBv4ZokslPzJqvcAO/MXvhfkk/q4Ms0bJh8fjw8LM/W4XNe
+QYWwntUN6LJ85cXbN09wvSZh5NYRqEQMVHAeIRzaKka4Jbib9mSt/voxbzvYiHSt
+jaSbtwsfQw67kfP6J1zcGq8cQXlt6oYyMc+NN2igcM1Uh11IsKBZ51ECAwEAAaNk
+MGIwHQYDVR0OBBYEFEcXCENhsmkLVlKECNTIXtP9t8SNMB8GA1UdIwQYMBaAFEcX
+CENhsmkLVlKECNTIXtP9t8SNMA8GA1UdEwEB/wQFMAMBAf8wDwYDVR0RBAgwBocE
+CioAATANBgkqhkiG9w0BAQsFAAOCAgEAjQAo4H2yc1+zyGTqNLb9b0VWvSKnM4si
+DGgu4LzU891/sQF6b42qoRQOnCUsySC57a4TYLat4ESOjhTijuZjWSyRkYiBag0O
+WuDXKBdhyEdRzoz9Alh0oiL/u8pHvk5ffWfSi5oF19dFwpYmjTX1gMhSZUb2ql8j
+l9buedFCsNt85C00a9lprztk9Tza73pXkCfXd7wCmVnBQeiwYp1OcFGm3p6eBUJC
+Zh9/3WtmsnOOXdC+/mMIh+DVOwyPLzPnG5Xtef40tXXiy+9l1ewCeeP+RnJH5sDM
+Xho9a7uvnNiyi0IfFlBsDC+Wsvq+k+fBLLQMq8oQjZ901Ty0fzp1+1pkCfvB4BOO
+74Bc6ekax9jYVWzMZ47WXJTvf+T8bVPyelBcNmVjDDFcALqI/gbhRXurjmLd+5S7
+3NkDTAU+6dj16R0V26pjq1YzXx6vVRAau+mYZqYCGsKzivLML3eEUK4WsLSRKtV0
+405MArAnVvk+bCgHp41UdYdqC3PkL2JFxNzUgtp0MMe5fRY7hVq0xJI01zwu7i9C
+cEBejFQpCVxQe5LnSJOSrFRYrZRzTEzGXsg6yKaxuiAFS3m6oIkiH+DSfI9HeiZV
+1n7q0zPYxjfR01C1C3VwAd/4z5esQJ+z42VffDE8fBzK5XdSAGy65VQdtKtPt0jE
+E4GvTlf+S3U=
+-----END CERTIFICATE-----
diff --git a/test/e2e/assets/registry.key b/test/e2e/assets/registry.key
new file mode 100644
index 0000000..65b3e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JA1dqQ10BwuNUzFPypNoZ7UoG+Igf2zm
+ow6GSYMmnNmuDBf+ZZdpMHIvsmUVorNp8zK12JwDdGbo1zJM+Yv7nUaC+uOtmVj3
+6s67HUzoeh083rX2A1SDRB95PGzWMu0=
+-----END PRIVATE KEY-----
diff --git a/test/e2e/bin/install.sh b/test/e2e/bin/install.sh
new file mode 100755
index 0000000..d2be7dc
--- /dev/null
+++ b/test/e2e/bin/install.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+set -o pipefail
+set -x
+
+BASE_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/.."
+
+sudo mkdir -p /etc/rancher/k3s
+sudo mkdir -p /etc/docker
+
+sudo cp ${BASE_DIR}/assets/registries.yaml /etc/rancher/k3s/registry.yaml
+sudo cp ${BASE_DIR}/assets/registry.crt /etc/rancher/k3s/local.crt
+sudo cp ${BASE_DIR}/assets/daemon.json /etc/docker/daemon.json
+
+sudo systemctl restart k3s docker
diff --git a/test/e2e/containers/git/Dockerfile b/test/e2e/containers/git/Dockerfile
new file mode 100644
index 0000000..26c267f
--- /dev/null
+++ b/test/e2e/containers/git/Dockerfile
@@ -0,0 +1,22 @@
+FROM nginx:alpine
+
+RUN set -x && \
+ apk --update upgrade && \
+ apk add git git-daemon bash fcgiwrap spawn-fcgi wget && \
+ adduser git -h /var/lib/git -D && \
+ adduser nginx git && \
+ git config --system http.receivepack true && \
+ git config --system http.uploadpack true && \
+ git config --system user.email "gitserver@git.com" && \
+ git config --system user.name "Git Server" && \
+ ln -sf /dev/stdout /var/log/nginx/access.log && \
+ ln -sf /dev/stderr /var/log/nginx/error.log
+
+
+ADD ./etc /etc
+ADD ./entrypoint.sh /usr/local/bin/entrypoint
+
+ENTRYPOINT [ "entrypoint" ]
+CMD [ "-start" ]
+
+ADD ./testdata /var/lib/initial/testdata
diff --git a/test/e2e/containers/git/LICENSE b/test/e2e/containers/git/LICENSE
new file mode 100644
index 0000000..fe26311
--- /dev/null
+++ b/test/e2e/containers/git/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 anyakichi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/test/e2e/containers/git/README.md b/test/e2e/containers/git/README.md
new file mode 100644
index 0000000..a310944
--- /dev/null
+++ b/test/e2e/containers/git/README.md
@@ -0,0 +1,81 @@
+# gitserver-http [![Build Status](https://travis-ci.org/cirocosta/gitserver-http.svg?branch=master)](https://travis-ci.org/cirocosta/gitserver-http)
+
+> A git server with Nginx as the HTTP frontend and fast cgi wrapper for running the git http backend
+
+
+## Usage
+
+To run a git server without any repositories configured in advance but allowing them to be saved into `./repositories`:
+
+ ```sh
+ docker run \
+ -d \ # deamonize
+ -v `pwd`/repositories:/var/lib/git \ # mount the volume
+ -p "8080:80" \ # expose the port
+ cirocosta/gitserver-http
+ ```
+
+Now, initialize a bare repository:
+
+ ```sh
+ cd repositories
+ git init --bare myrepo.git
+ ```
+
+and then, just clone it somewhere else:
+
+ ```sh
+ cd /tmp
+ git clone http://localhost:8080/myrepo.git
+ cd myrepo
+ ```
+
+
+### Pre-Initialization
+
+Git servers work with bare repositories. This image provides the utility of initializing some pre-configured repositories in advance. Just add them to `/var/lib/initial` and then run the container. For instance, having the tree:
+
+ ```
+ .
+ └── initial
+ └── initial
+ └── repo1
+ └── file.txt
+ ```
+
+and then executing
+
+ ```sh
+ docker run \
+ -d \ # deamonize
+ -v `pwd`/initial:/var/lib/initial \ # mount the initial volume
+ -p "8080:80" \ # expose the port
+ cirocosta/gitserver-http # start git server and init repositories
+ ```
+
+will allow you to skip the `git init --bare` step and start with the repositories pre-"installed" there:
+
+ ```sh
+ git clone http://localhost/repo1.git
+ cd repo1 && ls
+ # file.txt
+ ```
+
+
+## Example
+
+to run the example:
+
+ ```sh
+ make example
+ ```
+
+
+This will create a git server http service on `:80`. Now you can clone the sample repository:
+
+
+ ```sh
+ git clone http://localhost:8080/repo1.git
+ ```
+
+
diff --git a/test/e2e/containers/git/entrypoint.sh b/test/e2e/containers/git/entrypoint.sh
new file mode 100755
index 0000000..450c5ea
--- /dev/null
+++ b/test/e2e/containers/git/entrypoint.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Initializes Nginx and the git cgi scripts
+# for git http-backend through fcgiwrap.
+#
+# Usage:
+# entrypoint <commands>
+#
+# Commands:
+# -start starts the git server (nginx + fcgi)
+#
+# -init turns directories under `/var/lib/initial`
+# into bare repositories at `/var/lib/git`
+#
+
+set -o errexit
+
+readonly GIT_PROJECT_ROOT="/var/lib/git"
+readonly GIT_INITIAL_ROOT="/var/lib/initial"
+readonly GIT_HTTP_EXPORT_ALL="true"
+readonly GIT_USER="git"
+readonly GIT_GROUP="git"
+
+readonly FCGIPROGRAM="/usr/bin/fcgiwrap"
+readonly USERID="nginx"
+readonly SOCKUSERID="$USERID"
+readonly FCGISOCKET="/var/run/fcgiwrap.socket"
+
+main() {
+ mkdir -p $GIT_PROJECT_ROOT
+
+ # Checks if $GIT_INITIAL_ROOT has files
+ if [[ $(ls -A ${GIT_INITIAL_ROOT}) ]]; then
+ initialize_initial_repositories
+ fi
+ initialize_services
+}
+
+initialize_services() {
+ # Check permissions on $GIT_PROJECT_ROOT
+ chown -R git:git $GIT_PROJECT_ROOT
+ chmod -R 775 $GIT_PROJECT_ROOT
+
+ /usr/bin/spawn-fcgi \
+ -s $FCGISOCKET \
+ -F 4 \
+ -u $USERID \
+ -g $USERID \
+ -U $USERID \
+ -G $GIT_GROUP -- \
+ "$FCGIPROGRAM"
+ exec nginx
+}
+
+initialize_initial_repositories() {
+ cd $GIT_INITIAL_ROOT
+ for dir in $(find . -name "*" -type d -maxdepth 1 -mindepth 1); do
+ echo "Initializing repository $dir"
+ init_and_commit $dir
+ done
+}
+
+init_and_commit() {
+ local dir=$1
+ local tmp_dir=$(mktemp -d)
+
+ cp -r $dir/* $tmp_dir
+ pushd . >/dev/null
+ cd $tmp_dir
+
+ if [[ -d "./.git" ]]; then
+ rm -rf ./.git
+ fi
+
+ git init &>/dev/null
+ git add --all . &>/dev/null
+ git commit -m "first commit" &>/dev/null
+ git clone --bare $tmp_dir $GIT_PROJECT_ROOT/${dir}.git &>/dev/null
+
+ popd >/dev/null
+}
+
+main "$@"
diff --git a/test/e2e/containers/git/etc/nginx/htpasswd b/test/e2e/containers/git/etc/nginx/htpasswd
new file mode 100644
index 0000000..77d0449
--- /dev/null
+++ b/test/e2e/containers/git/etc/nginx/htpasswd
@@ -0,0 +1 @@
+git:$apr1$tL9/Fog7$cQy1CVgUVl6yzzXjkvNuE.
diff --git a/test/e2e/containers/git/etc/nginx/localhost.crt b/test/e2e/containers/git/etc/nginx/localhost.crt
new file mode 100644
index 0000000..9bd44e6
--- /dev/null
+++ b/test/e2e/containers/git/etc/nginx/localhost.crt
@@ -0,0 +1,30 @@
+-----BEGIN CERTIFICATE-----
+MIIFGjCCAwKgAwIBAgIUJ3mCB9CXDOrUm9CziCtOz3oKNfYwDQYJKoZIhvcNAQEL
+BQAwFDESMBAGA1UEAwwJMTAuN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T+4h31JXk223N5rkJyJ3
+qhB1pVxk5EDCYlSBHzeezjYCGkCCv/cBVbx53Uxrzu+X4MNnyretWsxr+LE4RRfH
+IDW+r87hwyRzi/qvechJCwnIC9C8YzMfaZk+ygD1AvTvJ4XLg+mT0z73Y2myljow
+bFHvFhCvnWJT0xl0CzSabz7Aj2IT3a5DpKZ7NZbXkOyWiQ2bGsbJXJ8WukK8F3Ba
+JTTQcboxDlfqeH1AGTXjU0hbZ7hF6yt0gQO8RKYZ8uNk/mz3KLCKvqxfdHaJVIRP
+Lhn0e55xTWcE+ZpsTIF5vBfEFSpYC3fpU2Nlb0bB+qW0A1nCz1v0M5/12bWzNGZo
+YhR06sCATxfa3irmiXqwXW/fD+WUZ1n9h9CIV216osK5NP3IE0P4NrdTwJI62KkB
+t5MheCjsn25gsSchackbPt9JP4jxpDBhMdAGEFpbDvR1KbPi2duRFGNCdSeME79Z
+bF9Kws7ORHE7pCl0qErIP+MwkpgJ9SOj28C+Gh0XuSU+fBb2T9xbUnVAOa+EcSb8
+X9n6WAG8Rcinljq5wgy84y81n7uYtbXCE0JLCkuo7lZIe68rfYUnOhVabfVmu0WY
+bBake+8KnTkoefuMcvE=
+-----END CERTIFICATE-----
diff --git a/test/e2e/containers/git/etc/nginx/localhost.key b/test/e2e/containers/git/etc/nginx/localhost.key
new file mode 100644
index 0000000..fd544c4
--- /dev/null
+++ b/test/e2e/containers/git/etc/nginx/localhost.key
@@ -0,0 +1,52 @@
+-----BEGIN PRIVATE KEY-----
+MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDHTpCplf+F/FZZ
+uWp49f5mVJyCg9pFK3e74hfmf1RxeEtLL38/PBrx8ZmmLCZH81Mc53iKdOxvTbw4
+qhztPCuWobgF5FVRNQMtiOnMKTd8asI5FJmtaXytu5dXxkeZ4DhRjR5cOcGzkHVQ
+EN5G/u6YqjduCAKvzFWEOpgnpMtvCMHt85GITfe6LGlVe9FC1EYPX0FZ9U5G8y/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z+yWaqN8xZ5JRWl4kz/0crTyO8iQ
+UJVAFkJoqxm5oAIbWC7wTwKe3E6FbuHmzV+eaFh3buFnODTFh8md49yJDFmqOpkB
+ab86LM26diDFibsH8DtHz1AprT7Pw8AtORV965yVAoIBAFbTfNaPPTIpYP8SOvWp
+4z5Q2N1jZPJh2XzIVvbTxXIjSzLudy35p16k//D4V5Wm5AdZxW/grrNlCOGkRMLi
+IbgPCHZylLKY1//BeZ42PRCJRrT5HullM9nzUKIjAgk5sH83I42XJ3PYkYn5+b0b
+IKArzxzIMevyLcq2hYhqr4c/TGBgleyZmsMSbnCUUR6lXic1/58fRQMVJYS7viae
+huIFDPvZyFjOGFKy716Y/NRAiKwOfTWHnjrLTzMkF509gPbmKYWtSXX/JcFoxTee
+zRFElLoXYJBlXr3vUsIYIxVMi6X6dhTQxyyqpxWg9M71bX7M2rC2BpDKQeGZaITm
+XUkCggEBAJCHV3XLHBurOUCnihukDV9++FWESSWE+yX34lHEd+2Edz4B4mmh20p5
+O4t2gguuqAU/ovlv8sXXRNtUTZOpERc2DFK1W8ZihYImLrDIifE7G4cIJkDVtXzd
+o/A+nvv/IQK3tidWVa67HOjRfgsfXG/6MJsc26DImgU5D3RebLM3ELEeeuImNyRS
+HHtaKIdW3QS5b3FxJA1Kx6iTXWVdh4GSERrjmCAMXgvawf7qqmpQwZCVwle5jXkF
+0Jn3TgkdJlkujzBtAJdD0UMqlV01Ag2eqLDhkBADRIyzTpNe3PMKwPJreoX7N4t+
+jIAssygju8SOTM1AFZfOU78UuDJva4U=
+-----END PRIVATE KEY-----
diff --git a/test/e2e/containers/git/etc/nginx/nginx.conf b/test/e2e/containers/git/etc/nginx/nginx.conf
new file mode 100644
index 0000000..f49a937
--- /dev/null
+++ b/test/e2e/containers/git/etc/nginx/nginx.conf
@@ -0,0 +1,29 @@
+user nginx;
+worker_processes 4;
+pid /run/nginx.pid;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ sendfile on;
+ tcp_nopush on;
+ tcp_nodelay on;
+ keepalive_timeout 65;
+ types_hash_max_size 2048;
+
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ access_log /var/log/nginx/access.log;
+ error_log /var/log/nginx/error.log;
+
+ gzip on;
+ gzip_disable "msie6";
+
+ include /etc/nginx/sites-enabled/*;
+}
+
+
+daemon off;
diff --git a/test/e2e/containers/git/etc/nginx/sites-enabled/git-http-auth b/test/e2e/containers/git/etc/nginx/sites-enabled/git-http-auth
new file mode 100644
index 0000000..68e31b7
--- /dev/null
+++ b/test/e2e/containers/git/etc/nginx/sites-enabled/git-http-auth
@@ -0,0 +1,36 @@
+server {
+ server_name _;
+ listen 8081 ssl;
+ listen [::]:8081 ssl;
+
+ ssl_certificate localhost.crt;
+ ssl_certificate_key localhost.key;
+ ssl_protocols TLSv1.2 TLSv1.3;
+
+ auth_basic "git";
+ auth_basic_user_file "/etc/nginx/htpasswd";
+
+ location /ping {
+ add_header Content-Type text/plain;
+ return 200 'pong';
+ }
+
+ location ~ ^.*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx))$ {
+ root /var/lib/git;
+ }
+
+ location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
+ fastcgi_param GIT_HTTP_EXPORT_ALL "";
+ fastcgi_param GIT_PROJECT_ROOT /var/lib/git;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_param REMOTE_USER admin;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ }
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+}
+
diff --git a/test/e2e/containers/git/etc/nginx/sites-enabled/git-http-noauth b/test/e2e/containers/git/etc/nginx/sites-enabled/git-http-noauth
new file mode 100644
index 0000000..a1c305c
--- /dev/null
+++ b/test/e2e/containers/git/etc/nginx/sites-enabled/git-http-noauth
@@ -0,0 +1,29 @@
+server {
+ server_name _;
+ listen 8080 default_server;
+ listen [::]:8080 default_server;
+
+ location /ping {
+ add_header Content-Type text/plain;
+ return 200 'pong';
+ }
+
+ location ~ ^.*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx))$ {
+ root /var/lib/git;
+ }
+
+ location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
+ fastcgi_param GIT_HTTP_EXPORT_ALL "";
+ fastcgi_param GIT_PROJECT_ROOT /var/lib/git;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_param REMOTE_USER admin;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ }
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+}
+
diff --git a/test/e2e/containers/git/example/docker-compose.no-init.yml b/test/e2e/containers/git/example/docker-compose.no-init.yml
new file mode 100644
index 0000000..f374412
--- /dev/null
+++ b/test/e2e/containers/git/example/docker-compose.no-init.yml
@@ -0,0 +1,8 @@
+version: '3.2'
+services:
+ gitserver:
+ image: 'cirocosta/gitserver-http'
+ command:
+ - '-start'
+ ports:
+ - '8082:80'
diff --git a/test/e2e/containers/git/example/docker-compose.yml b/test/e2e/containers/git/example/docker-compose.yml
new file mode 100644
index 0000000..a8c9036
--- /dev/null
+++ b/test/e2e/containers/git/example/docker-compose.yml
@@ -0,0 +1,11 @@
+version: '3.2'
+services:
+ gitserver:
+ image: 'cirocosta/gitserver-http'
+ command:
+ - '-init'
+ - '-start'
+ volumes:
+ - './initial:/var/lib/initial:ro'
+ ports:
+ - '8080:80'
diff --git a/test/e2e/containers/git/example/initial/myrepo/myfile.txt b/test/e2e/containers/git/example/initial/myrepo/myfile.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/e2e/containers/git/example/initial/myrepo/myfile.txt
diff --git a/test/e2e/containers/git/example/initial/myrepo2/myfile2.txt b/test/e2e/containers/git/example/initial/myrepo2/myfile2.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/e2e/containers/git/example/initial/myrepo2/myfile2.txt
diff --git a/test/e2e/containers/git/test.sh b/test/e2e/containers/git/test.sh
new file mode 100755
index 0000000..9066017
--- /dev/null
+++ b/test/e2e/containers/git/test.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -o errexit
+set -o xtrace
+
+main() {
+ init_docker_container
+ sleep 3
+ assert_can_clone
+}
+
+init_docker_container() {
+ docker-compose \
+ -f ./example/docker-compose.yml \
+ up \
+ -d
+}
+
+assert_can_clone() {
+ git clone http://localhost:8080/myrepo.git
+ [[ -f "myrepo/myfile.txt" ]] || exit 1
+
+ echo "OK!"
+}
+
+cleanup() {
+ local exit_code=$?
+
+ echo "Exited with [$exit_code]"
+ docker-compose \
+ -f ./example/docker-compose.yml \
+ stop
+ rm -rf ./myrepo
+}
+
+trap cleanup EXIT
+main
diff --git a/test/e2e/containers/git/testdata/001-simple-kustomize-app/deployment.yaml b/test/e2e/containers/git/testdata/001-simple-kustomize-app/deployment.yaml
new file mode 100644
index 0000000..7c7ccb9
--- /dev/null
+++ b/test/e2e/containers/git/testdata/001-simple-kustomize-app/deployment.yaml
@@ -0,0 +1,20 @@
+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: test
+ image: 10.42.0.1:30000/test-image:1.0.0
+
diff --git a/test/e2e/containers/git/testdata/001-simple-kustomize-app/kustomization.yaml b/test/e2e/containers/git/testdata/001-simple-kustomize-app/kustomization.yaml
new file mode 100644
index 0000000..9519a26
--- /dev/null
+++ b/test/e2e/containers/git/testdata/001-simple-kustomize-app/kustomization.yaml
@@ -0,0 +1,2 @@
+resources:
+ - deployment.yaml
diff --git a/test/e2e/containers/git/testdata/001/deployment.yaml b/test/e2e/containers/git/testdata/001/deployment.yaml
new file mode 100644
index 0000000..7c7ccb9
--- /dev/null
+++ b/test/e2e/containers/git/testdata/001/deployment.yaml
@@ -0,0 +1,20 @@
+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: test
+ image: 10.42.0.1:30000/test-image:1.0.0
+
diff --git a/test/e2e/containers/git/testdata/001/kustomization.yaml b/test/e2e/containers/git/testdata/001/kustomization.yaml
new file mode 100644
index 0000000..9519a26
--- /dev/null
+++ b/test/e2e/containers/git/testdata/001/kustomization.yaml
@@ -0,0 +1,2 @@
+resources:
+ - deployment.yaml
diff --git a/test/e2e/e2e-test.sh b/test/e2e/e2e-test.sh
new file mode 100755
index 0000000..cd97c0c
--- /dev/null
+++ b/test/e2e/e2e-test.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+set -e
+set -o pipefail
+
+E2E_NAMESPACE=argocd-image-updater-e2e
+E2E_TIMEOUT=120
+E2E_REGISTRY_NOAUTH="10.42.0.1:30000"
+E2E_REGISTRY_AUTH="10.42.0.1:30001"
+
+SRC_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../.."
+export SRC_DIR
+
+restart_registry() {
+ t="$1"
+ kubectl -n $E2E_NAMESPACE rollout restart deployment e2e-registry-$t
+ kubectl -n $E2E_NAMESPACE rollout status deployment e2e-registry-$t
+}
+
+restart_repository() {
+ kubectl -n $E2E_NAMESPACE rollout restart deployment e2e-repository
+ kubectl -n $E2E_NAMESPACE rollout status deployment e2e-repository
+}
+
+build_image_if_not_exist() {
+ name="$1"
+ tag="$2"
+ found=$(docker images --format '{{.Repository}}:{{.Tag}}' $name:$tag)
+ if ! test "$found" = "$name:$tag"; then
+ (
+ cd images
+ IMAGE_TAG=$tag make build-and-push
+ )
+ fi
+}
+
+prepare_registry() {
+ make git-container-build
+ restart_registry public
+ restart_registry private
+ make git-container-push
+ restart_repository
+ (
+ cd images
+ IMAGE_TAG=1.0.0 make push
+ IMAGE_TAG=1.0.1 make push
+ IMAGE_TAG=1.0.2 make push
+ IMAGE_TAG=latest make push
+ )
+}
+
+if ! kubectl kuttl version >/dev/null 2>&1; then
+ echo "kuttl seems not installed; aborting" >&2
+ exit 1
+fi
+
+for tag in 1.0.0 1.0.1 1.0.2 2.0.0 2.0.1 2.1.0 latest; do
+ build_image_if_not_exist "10.42.0.1:30000/test-image" "$tag"
+done
+
+prepare_registry
+
+kubectl kuttl test --namespace ${E2E_NAMESPACE} --timeout ${E2E_TIMEOUT} $*
diff --git a/test/e2e/images/Makefile b/test/e2e/images/Makefile
new file mode 100644
index 0000000..46fdc94
--- /dev/null
+++ b/test/e2e/images/Makefile
@@ -0,0 +1,15 @@
+REGISTRY_PREFIX ?= 10.42.0.1:30000
+IMAGE_NAME ?= test-image
+IMAGE_TAG ?= 1.0.0
+
+build-and-push: build push
+
+build:
+ docker build --no-cache -f test-image/Dockerfile -t $(REGISTRY_PREFIX)/$(IMAGE_NAME):$(IMAGE_TAG) test-image
+
+push:
+ docker push $(REGISTRY_PREFIX)/$(IMAGE_NAME):$(IMAGE_TAG)
+
+.PHONY: build-and-push
+.PHONY: build
+.PHONY: push
diff --git a/test/e2e/images/test-image/Dockerfile b/test/e2e/images/test-image/Dockerfile
new file mode 100644
index 0000000..8f0a0e5
--- /dev/null
+++ b/test/e2e/images/test-image/Dockerfile
@@ -0,0 +1,5 @@
+FROM busybox
+COPY ./entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+ENTRYPOINT ["/entrypoint.sh"]
+RUN echo $RANDOM > /tmp/random
diff --git a/test/e2e/images/test-image/entrypoint.sh b/test/e2e/images/test-image/entrypoint.sh
new file mode 100755
index 0000000..0665278
--- /dev/null
+++ b/test/e2e/images/test-image/entrypoint.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+tail -f /dev/stdout
diff --git a/test/e2e/kuttl-test.yaml b/test/e2e/kuttl-test.yaml
new file mode 100644
index 0000000..23c2582
--- /dev/null
+++ b/test/e2e/kuttl-test.yaml
@@ -0,0 +1,11 @@
+apiVersion: kuttl.dev/v1beta1
+kind: TestSuite
+name: argocd-image-updater-e2e
+testDirs:
+ - ./suite
+suppress:
+ - events
+timeout: 30
+parallel: 1
+reportFormat: JSON
+reportName: argocd-image-updater-e2e
diff --git a/test/e2e/prereqs/argocd/clusterrolebinding.json b/test/e2e/prereqs/argocd/clusterrolebinding.json
new file mode 100644
index 0000000..3a1048d
--- /dev/null
+++ b/test/e2e/prereqs/argocd/clusterrolebinding.json
@@ -0,0 +1,7 @@
+[
+ {
+ "op": "replace",
+ "path": "/subjects/0/namespace",
+ "value": "argocd-image-updater-e2e"
+ }
+]
diff --git a/test/e2e/prereqs/argocd/kustomization.yaml b/test/e2e/prereqs/argocd/kustomization.yaml
new file mode 100644
index 0000000..bdd7286
--- /dev/null
+++ b/test/e2e/prereqs/argocd/kustomization.yaml
@@ -0,0 +1,11 @@
+resources:
+ - https://github.com/argoproj/argo-cd/manifests/cluster-install?ref=v2.1.5
+ - repository.yaml
+
+patches:
+ - path: clusterrolebinding.json
+ target:
+ group: rbac.authorization.k8s.io
+ version: v1
+ kind: ClusterRoleBinding
+ name: argocd-application-controller
diff --git a/test/e2e/prereqs/argocd/repository.yaml b/test/e2e/prereqs/argocd/repository.yaml
new file mode 100644
index 0000000..144fbb4
--- /dev/null
+++ b/test/e2e/prereqs/argocd/repository.yaml
@@ -0,0 +1,14 @@
+apiVersion: v1
+kind: Secret
+metadata:
+ name: e2e-git-repo
+ labels:
+ argocd.argoproj.io/secret-type: repository
+ component: argocd-image-updater-e2e
+stringData:
+ url: https://10.42.0.1:30003/testdata.git
+ type: git
+ password: git
+ username: git
+ insecure: "true"
+
diff --git a/test/e2e/prereqs/registry/registry.yaml b/test/e2e/prereqs/registry/registry.yaml
new file mode 100644
index 0000000..be6d0c6
--- /dev/null
+++ b/test/e2e/prereqs/registry/registry.yaml
@@ -0,0 +1,333 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: e2e-registry-public
+ labels:
+ app: registry
+ type: public
+ component: argocd-image-updater-e2e
+data:
+ registry.conf: |
+ version: 0.1
+ storage:
+ filesystem:
+ rootdirectory: /var/lib/storage
+ maxthreads: 100
+ http:
+ addr: 0.0.0.0:5000
+ tls:
+ certificate: /tmp/config/registry.crt
+ key: /tmp/config/registry.key
+ registry.crt: |
+ -----BEGIN CERTIFICATE-----
+ MIIFpDCCA4ygAwIBAgIUAsEthF+di48FNSBsjeTHyNb5ojYwDQYJKoZIhvcNAQEL
+ BQAwWTELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UE
+ CgwTRGVmYXVsdCBDb21wYW55IEx0ZDEVMBMGA1UEAwwMZTJlLXJlZ2lzdHJ5MB4X
+ DTIxMTAwODExNTQxNloXDTIyMTAwODExNTQxNlowWTELMAkGA1UEBhMCWFgxFTAT
+ BgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0
+ ZDEVMBMGA1UEAwwMZTJlLXJlZ2lzdHJ5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
+ MIICCgKCAgEA6sIOAHpasH3UxwJJvyIJc144u52QsenJ6eZM7XShwPSQURkiubks
+ +OwiCFQVKJGn80cdDzMdhaPQSXZzJETC7/cHFFndQrpRe6E2OJu3AZZVD0b+c4hB
+ KPLZiWrtQtThlV+YjJ69YdMCGR4+Ph0gwptm4XNUzIXTFmVsjmi2oja6hpN0P8NB
+ 6np9u7ckJIaj38RbIBRm5KDnvOVbvxapXJHotpmLiGF8GEG4H0/Sw1g8vsanU8dV
+ nidtHqx2+JnC6FE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oBlwE9OIeGgXJsmzkwR1nJfVSNkV8Gm6P0T8K3Vp0IG1Pl0tbOFSMT7
+ oWUCggEBAMLfQgQ5NkGe52OMjTiYThIQPo2GHIUJJuzY7SUB6UK5LCcnEkQJbd3X
+ Gu35pDg8RD/3Gt+bFJ6Xe8GCIU9NtVEF/0cwtxdBJprSSX4kYGQ7hcNg/gY2hxgj
+ 6yy+Y0SQzwzjCOxoEvrGSiewZX8oXZBXye4iZwSOoojHZuUduf6t+AD2/hbg/Jl0
+ unPtJNs37Pg14RLqu6yeZlT3o9TBLMpeJA1dqQ10BwuNUzFPypNoZ7UoG+Igf2zm
+ ow6GSYMmnNmuDBf+ZZdpMHIvsmUVorNp8zK12JwDdGbo1zJM+Yv7nUaC+uOtmVj3
+ 6s67HUzoeh083rX2A1SDRB95PGzWMu0=
+ -----END PRIVATE KEY-----
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: e2e-registry-public
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: registry
+ type: public
+ component: argocd-image-updater-e2e
+ template:
+ metadata:
+ labels:
+ app: registry
+ type: public
+ component: argocd-image-updater-e2e
+ spec:
+ containers:
+ - name: registry
+ command:
+ - registry
+ - serve
+ - /tmp/config/registry.conf
+ image: registry
+ ports:
+ - containerPort: 5000
+ volumeMounts:
+ - name: config
+ mountPath: /tmp/config
+ volumes:
+ - name: config
+ configMap:
+ name: e2e-registry-public
+ items:
+ - key: registry.conf
+ path: registry.conf
+ - key: registry.crt
+ path: registry.crt
+ - key: registry.key
+ path: registry.key
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: e2e-registry-public
+spec:
+ type: NodePort
+ selector:
+ app: registry
+ type: public
+ ports:
+ - protocol: TCP
+ port: 443
+ targetPort: 5000
+ nodePort: 30000
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: e2e-registry-private
+ labels:
+ app: registry
+ type: private
+ component: argocd-image-updater-e2e
+data:
+ registry.conf: |
+ version: 0.1
+ storage:
+ filesystem:
+ rootdirectory: /var/lib/storage
+ maxthreads: 100
+ http:
+ addr: 0.0.0.0:5000
+ tls:
+ certificate: /tmp/config/registry.crt
+ key: /tmp/config/registry.key
+ registry.crt: |
+ -----BEGIN CERTIFICATE-----
+ MIIFpDCCA4ygAwIBAgIUAsEthF+di48FNSBsjeTHyNb5ojYwDQYJKoZIhvcNAQEL
+ BQAwWTELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UE
+ CgwTRGVmYXVsdCBDb21wYW55IEx0ZDEVMBMGA1UEAwwMZTJlLXJlZ2lzdHJ5MB4X
+ DTIxMTAwODExNTQxNloXDTIyMTAwODExNTQxNlowWTELMAkGA1UEBhMCWFgxFTAT
+ BgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0
+ ZDEVMBMGA1UEAwwMZTJlLXJlZ2lzdHJ5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
+ MIICCgKCAgEA6sIOAHpasH3UxwJJvyIJc144u52QsenJ6eZM7XShwPSQURkiubks
+ +OwiCFQVKJGn80cdDzMdhaPQSXZzJETC7/cHFFndQrpRe6E2OJu3AZZVD0b+c4hB
+ KPLZiWrtQtThlV+YjJ69YdMCGR4+Ph0gwptm4XNUzIXTFmVsjmi2oja6hpN0P8NB
+ 6np9u7ckJIaj38RbIBRm5KDnvOVbvxapXJHotpmLiGF8GEG4H0/Sw1g8vsanU8dV
+ nidtHqx2+JnC6FEo9ATThbse9zBwzHIaAgoeracATVXLbWK4Todsxe9NAtMZ80DQ
+ 1W78EN/7vrHUDFMNXxP0itL5ZoVu8DGhpjmvZWt5vwES5kfZPKbBJ2zBewBxl26f
+ NruDY5dQAvbXee4I2Lihny3nLL131qqVrlL2DUv+FNvuDgFp+O15XYtTrIlYrWrj
+ 9seQ/6PuXASs1JddadZwGBkNni+jjSkcnuSYqMRop7/diPxGXj+sEv/FDoA2sGwB
+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OoojHZuUduf6t+AD2/hbg/Jl0
+ unPtJNs37Pg14RLqu6yeZlT3o9TBLMpeJA1dqQ10BwuNUzFPypNoZ7UoG+Igf2zm
+ ow6GSYMmnNmuDBf+ZZdpMHIvsmUVorNp8zK12JwDdGbo1zJM+Yv7nUaC+uOtmVj3
+ 6s67HUzoeh083rX2A1SDRB95PGzWMu0=
+ -----END PRIVATE KEY-----
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: e2e-registry-private
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: registry
+ type: private
+ component: argocd-image-updater-e2e
+ template:
+ metadata:
+ labels:
+ app: registry
+ type: private
+ component: argocd-image-updater-e2e
+ spec:
+ containers:
+ - name: registry
+ command:
+ - registry
+ - serve
+ - /tmp/config/registry.conf
+ image: registry
+ ports:
+ - containerPort: 5000
+ volumeMounts:
+ - name: config
+ mountPath: /tmp/config
+ volumes:
+ - name: config
+ configMap:
+ name: e2e-registry-private
+ items:
+ - key: registry.conf
+ path: registry.conf
+ - key: registry.crt
+ path: registry.crt
+ - key: registry.key
+ path: registry.key
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: e2e-registry-private
+spec:
+ type: NodePort
+ selector:
+ app: registry
+ type: private
+ ports:
+ - protocol: TCP
+ port: 443
+ targetPort: 5000
+ nodePort: 30001
+---
+
diff --git a/test/e2e/prereqs/repo/install.yaml b/test/e2e/prereqs/repo/install.yaml
new file mode 100644
index 0000000..6395150
--- /dev/null
+++ b/test/e2e/prereqs/repo/install.yaml
@@ -0,0 +1,43 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: e2e-repository
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: repository
+ component: argocd-image-updater-e2e
+ template:
+ metadata:
+ labels:
+ app: repository
+ component: argocd-image-updater-e2e
+ spec:
+ containers:
+ - name: git-http
+ image: 10.42.0.1:30000/git-http:latest
+ imagePullPolicy: Always
+ ports:
+ - containerPort: 8080
+ - containerPort: 8081
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: e2e-repository
+spec:
+ type: NodePort
+ selector:
+ app: repository
+ ports:
+ - protocol: TCP
+ port: 8080
+ targetPort: 8080
+ nodePort: 30002
+ name: unauth
+ - protocol: TCP
+ port: 8081
+ targetPort: 8081
+ nodePort: 30003
+ name: auth
diff --git a/test/e2e/suite/001-simple-kustomize-app-semver/01-assert.yaml b/test/e2e/suite/001-simple-kustomize-app-semver/01-assert.yaml
new file mode 100644
index 0000000..9c06c8d
--- /dev/null
+++ b/test/e2e/suite/001-simple-kustomize-app-semver/01-assert.yaml
@@ -0,0 +1,9 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-001
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced \ No newline at end of file
diff --git a/test/e2e/suite/001-simple-kustomize-app-semver/01-install.yaml b/test/e2e/suite/001-simple-kustomize-app-semver/01-install.yaml
new file mode 100644
index 0000000..6322989
--- /dev/null
+++ b/test/e2e/suite/001-simple-kustomize-app-semver/01-install.yaml
@@ -0,0 +1,27 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: image-updater-e2e-001
+---
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-001
+ annotations:
+ argocd-image-updater.argoproj.io/image-list: test=10.42.0.1:30000/test-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: ./001-simple-kustomize-app
+ targetRevision: HEAD
+ destination:
+ server: https://kubernetes.default.svc
+ namespace: image-updater-e2e-001
+ syncPolicy:
+ automated: {}
+ retry:
+ limit: 2 \ No newline at end of file
diff --git a/test/e2e/suite/001-simple-kustomize-app-semver/02-assert.yaml b/test/e2e/suite/001-simple-kustomize-app-semver/02-assert.yaml
new file mode 100644
index 0000000..71b6f43
--- /dev/null
+++ b/test/e2e/suite/001-simple-kustomize-app-semver/02-assert.yaml
@@ -0,0 +1,22 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-001
+spec:
+ source:
+ kustomize:
+ images:
+ - 10.42.0.1:30000/test-image:1.0.2
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced
+---
+apiVersion: v1
+kind: Pod
+metadata:
+ namespace: image-updater-e2e-001
+spec:
+ containers:
+ - image: 10.42.0.1:30000/test-image:1.0.2 \ No newline at end of file
diff --git a/test/e2e/suite/001-simple-kustomize-app-semver/02-run-updater.yaml b/test/e2e/suite/001-simple-kustomize-app-semver/02-run-updater.yaml
new file mode 100644
index 0000000..db51f3f
--- /dev/null
+++ b/test/e2e/suite/001-simple-kustomize-app-semver/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/001-simple-kustomize-app-semver/99-delete.yaml b/test/e2e/suite/001-simple-kustomize-app-semver/99-delete.yaml
new file mode 100644
index 0000000..a809db1
--- /dev/null
+++ b/test/e2e/suite/001-simple-kustomize-app-semver/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-001
+- apiVersion: v1
+ kind: Namespace
+ name: image-updater-e2e-001 \ No newline at end of file
diff --git a/test/e2e/suite/002-simple-kustomize-app-latest/00-build.yaml b/test/e2e/suite/002-simple-kustomize-app-latest/00-build.yaml
new file mode 100644
index 0000000..af620e8
--- /dev/null
+++ b/test/e2e/suite/002-simple-kustomize-app-latest/00-build.yaml
@@ -0,0 +1,7 @@
+apiVersion: kuttl.dev/v1beta1
+kind: TestStep
+commands:
+- script: |
+ echo "Building first image"
+ cd $SRC_DIR/test/e2e/images
+ IMAGE_TAG=latest make \ No newline at end of file
diff --git a/test/e2e/suite/002-simple-kustomize-app-latest/01-assert.yaml b/test/e2e/suite/002-simple-kustomize-app-latest/01-assert.yaml
new file mode 100644
index 0000000..e1b6aa7
--- /dev/null
+++ b/test/e2e/suite/002-simple-kustomize-app-latest/01-assert.yaml
@@ -0,0 +1,9 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-002
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced \ No newline at end of file
diff --git a/test/e2e/suite/002-simple-kustomize-app-latest/01-install.yaml b/test/e2e/suite/002-simple-kustomize-app-latest/01-install.yaml
new file mode 100644
index 0000000..aa64092
--- /dev/null
+++ b/test/e2e/suite/002-simple-kustomize-app-latest/01-install.yaml
@@ -0,0 +1,28 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: image-updater-e2e-002
+---
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-002
+ annotations:
+ argocd-image-updater.argoproj.io/image-list: test=10.42.0.1:30000/test-image:latest
+ argocd-image-updater.argoproj.io/test.update-strategy: digest
+ argocd-image-updater.argoproj.io/write-back-method: git
+ finalizers:
+ - resources-finalizer.argocd.argoproj.io
+spec:
+ project: default
+ source:
+ repoURL: https://10.42.0.1:30003/testdata.git
+ path: ./001-simple-kustomize-app
+ targetRevision: HEAD
+ destination:
+ server: https://kubernetes.default.svc
+ namespace: image-updater-e2e-002
+ syncPolicy:
+ automated: {}
+ retry:
+ limit: 2 \ No newline at end of file
diff --git a/test/e2e/suite/002-simple-kustomize-app-latest/02-assert.yaml b/test/e2e/suite/002-simple-kustomize-app-latest/02-assert.yaml
new file mode 100644
index 0000000..1e419d3
--- /dev/null
+++ b/test/e2e/suite/002-simple-kustomize-app-latest/02-assert.yaml
@@ -0,0 +1,17 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-002
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ namespace: image-updater-e2e-002
+status:
+ observedGeneration: 2
+ readyReplicas: 1 \ No newline at end of file
diff --git a/test/e2e/suite/002-simple-kustomize-app-latest/02-run-updater.yaml b/test/e2e/suite/002-simple-kustomize-app-latest/02-run-updater.yaml
new file mode 100644
index 0000000..2982fc1
--- /dev/null
+++ b/test/e2e/suite/002-simple-kustomize-app-latest/02-run-updater.yaml
@@ -0,0 +1,14 @@
+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
+- script: |
+ kubectl patch -n $NAMESPACE application image-updater-002 \
+ --type=merge \
+ --patch='{"metadata": {"annotations": {"argocd.argoproj.io/refresh": "hard"}}}'
+- script: |
+ sleep 5 \ No newline at end of file
diff --git a/test/e2e/suite/002-simple-kustomize-app-latest/99-delete.yaml b/test/e2e/suite/002-simple-kustomize-app-latest/99-delete.yaml
new file mode 100644
index 0000000..26723b4
--- /dev/null
+++ b/test/e2e/suite/002-simple-kustomize-app-latest/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-002
+- apiVersion: v1
+ kind: Namespace
+ name: image-updater-e2e-002 \ No newline at end of file
diff --git a/test/e2e/suite/003-invalid-image-specified/01-assert.yaml b/test/e2e/suite/003-invalid-image-specified/01-assert.yaml
new file mode 100644
index 0000000..e8f0141
--- /dev/null
+++ b/test/e2e/suite/003-invalid-image-specified/01-assert.yaml
@@ -0,0 +1,9 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-003
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced \ No newline at end of file
diff --git a/test/e2e/suite/003-invalid-image-specified/01-install.yaml b/test/e2e/suite/003-invalid-image-specified/01-install.yaml
new file mode 100644
index 0000000..681fcb0
--- /dev/null
+++ b/test/e2e/suite/003-invalid-image-specified/01-install.yaml
@@ -0,0 +1,27 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: image-updater-e2e-003
+---
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-003
+ annotations:
+ argocd-image-updater.argoproj.io/image-list: some/invalid:latest
+ argocd-image-updater.argoproj.io/demoimage.update-strategy: latest
+ finalizers:
+ - resources-finalizer.argocd.argoproj.io
+spec:
+ project: default
+ source:
+ repoURL: https://10.42.0.1:30003/testdata.git
+ path: ./001-simple-kustomize-app
+ targetRevision: HEAD
+ destination:
+ server: https://kubernetes.default.svc
+ namespace: image-updater-e2e-003
+ syncPolicy:
+ automated: {}
+ retry:
+ limit: 2 \ No newline at end of file
diff --git a/test/e2e/suite/003-invalid-image-specified/02-assert.yaml b/test/e2e/suite/003-invalid-image-specified/02-assert.yaml
new file mode 100644
index 0000000..1f52d60
--- /dev/null
+++ b/test/e2e/suite/003-invalid-image-specified/02-assert.yaml
@@ -0,0 +1,17 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Application
+metadata:
+ name: image-updater-003
+status:
+ health:
+ status: Healthy
+ sync:
+ status: Synced
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ namespace: image-updater-e2e-003
+status:
+ observedGeneration: 1
+ readyReplicas: 1 \ No newline at end of file
diff --git a/test/e2e/suite/003-invalid-image-specified/02-run-updater.yaml b/test/e2e/suite/003-invalid-image-specified/02-run-updater.yaml
new file mode 100644
index 0000000..a0ef3d0
--- /dev/null
+++ b/test/e2e/suite/003-invalid-image-specified/02-run-updater.yaml
@@ -0,0 +1,14 @@
+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
+- script: |
+ kubectl patch -n $NAMESPACE application image-updater-003 \
+ --type=merge \
+ --patch='{"metadata": {"annotations": {"argocd.argoproj.io/refresh": "hard"}}}'
+- script: |
+ sleep 5 \ No newline at end of file
diff --git a/test/e2e/suite/003-invalid-image-specified/99-delete.yaml b/test/e2e/suite/003-invalid-image-specified/99-delete.yaml
new file mode 100644
index 0000000..a4be4a0
--- /dev/null
+++ b/test/e2e/suite/003-invalid-image-specified/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-003
+- apiVersion: v1
+ kind: Namespace
+ name: image-updater-e2e-003 \ No newline at end of file
diff --git a/test/e2e/testdata/001-simple-kustomize-app/deployment.yaml b/test/e2e/testdata/001-simple-kustomize-app/deployment.yaml
new file mode 100644
index 0000000..7c7ccb9
--- /dev/null
+++ b/test/e2e/testdata/001-simple-kustomize-app/deployment.yaml
@@ -0,0 +1,20 @@
+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: test
+ image: 10.42.0.1:30000/test-image:1.0.0
+
diff --git a/test/e2e/testdata/001-simple-kustomize-app/kustomization.yaml b/test/e2e/testdata/001-simple-kustomize-app/kustomization.yaml
new file mode 100644
index 0000000..9519a26
--- /dev/null
+++ b/test/e2e/testdata/001-simple-kustomize-app/kustomization.yaml
@@ -0,0 +1,2 @@
+resources:
+ - deployment.yaml