Skip to content

Commit

Permalink
Activating instance admission controller for the e2e tests (#1473)
Browse files Browse the repository at this point in the history
Summary:
when initializing KUDO manager for the e2e tests we now use the `--webhook InstanceValidation --unsafe-self-signed-webhook-ca` options that activate the instance admission controller (IAC) using the self-signed webhook CA bundle. We must ensure that KUDO manager runs before we begin executing test steps, otherwise, IAC `MutatingWebhookConfiguration` will fail `CREATE` and `UPDATE` requests to the `Instance` resources if the webhook server is not up and running. To achieve this, I added first step to all e2e steps ensuring the `kudo-controller-manager` pod is `Running`.

Signed-off-by: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
  • Loading branch information
Aleksey Dukhovniy committed Apr 20, 2020
1 parent 5ca644e commit f181a85
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 46 deletions.
2 changes: 1 addition & 1 deletion hack/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ docker build . \
-t "kudobuilder/controller:$VERSION"

# Generate the kudo.yaml that is used to install KUDO while running e2e-test
./bin/kubectl-kudo init --dry-run --output yaml --kudo-image kudobuilder/controller:$VERSION \
./bin/kubectl-kudo init --webhook InstanceValidation --unsafe-self-signed-webhook-ca --dry-run --output yaml --kudo-image kudobuilder/controller:$VERSION \
| sed -E -e '/imagePullPolicy/ s/Always/Never/' \
> test/manifests/kudo.yaml

Expand Down
17 changes: 7 additions & 10 deletions test/e2e/cli-install-uninstall/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
apiVersion: kudo.dev/v1beta1
kind: Instance
apiVersion: v1
kind: Pod
metadata:
name: first-operator
labels:
app: kudo-manager
control-plane: controller-manager
namespace: kudo-system
status:
aggregatedStatus:
status: COMPLETE
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
phase: Running
12 changes: 12 additions & 0 deletions test/e2e/cli-install-uninstall/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
name: first-operator
status:
aggregatedStatus:
status: COMPLETE
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
14 changes: 6 additions & 8 deletions test/e2e/terminal-failed-job/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
apiVersion: kudo.dev/v1beta1
kind: Instance
apiVersion: v1
kind: Pod
metadata:
labels:
kudo.dev/operator: failjob-operator
spec:
operatorVersion:
name: failjob-operator-0.1.0
app: kudo-manager
control-plane: controller-manager
namespace: kudo-system
status:
aggregatedStatus:
status: FATAL_ERROR
phase: Running
6 changes: 3 additions & 3 deletions test/e2e/terminal-failed-job/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
labels:
kudo.dev/operator: job-timeout-operator
kudo.dev/operator: failjob-operator
spec:
operatorVersion:
name: job-timeout-operator-0.1.0
name: failjob-operator-0.1.0
status:
aggregatedStatus:
status: FATAL_ERROR
status: FATAL_ERROR
11 changes: 11 additions & 0 deletions test/e2e/terminal-failed-job/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
labels:
kudo.dev/operator: job-timeout-operator
spec:
operatorVersion:
name: job-timeout-operator-0.1.0
status:
aggregatedStatus:
status: FATAL_ERROR
21 changes: 6 additions & 15 deletions test/e2e/toggle-task/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
apiVersion: kudo.dev/v1beta1
kind: Instance
apiVersion: v1
kind: Pod
metadata:
labels:
kudo.dev/operator: feature-operator
spec:
operatorVersion:
name: feature-operator-0.1.0
app: kudo-manager
control-plane: controller-manager
namespace: kudo-system
status:
aggregatedStatus:
status: COMPLETE
---
apiVersion: v1
kind: ConfigMap
metadata:
name: feature-operator-cm
data:
foo: "1234"
phase: Running
7 changes: 7 additions & 0 deletions test/e2e/toggle-task/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ spec:
status:
aggregatedStatus:
status: COMPLETE
---
apiVersion: v1
kind: ConfigMap
metadata:
name: feature-operator-cm
data:
foo: "1234"
File renamed without changes.
15 changes: 10 additions & 5 deletions test/e2e/toggle-task/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
apiVersion: v1
kind: ConfigMap
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
name: feature-operator-cm
data:
foo: "1234"
labels:
kudo.dev/operator: feature-operator
spec:
operatorVersion:
name: feature-operator-0.1.0
status:
aggregatedStatus:
status: COMPLETE
File renamed without changes.
4 changes: 2 additions & 2 deletions test/e2e/toggle-task/02-update.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kudo.dev/v1beta1
kind: TestStep
commands:
- command: kubectl kudo update --instance feature-operator-instance -p enable_cm=true
namespaced: true
- command: kubectl kudo update --instance feature-operator-instance -p enable_cm=false
namespaced: true
6 changes: 6 additions & 0 deletions test/e2e/toggle-task/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: feature-operator-cm
data:
foo: "1234"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kudo.dev/v1beta1
kind: TestStep
commands:
- command: kubectl kudo update --instance feature-operator-instance -p enable_cm=false
namespaced: true
- command: kubectl kudo update --instance feature-operator-instance -p enable_cm=true
namespaced: true

0 comments on commit f181a85

Please sign in to comment.