Skip to content

Commit

Permalink
Add integration test for apply-delete-apply bug
Browse files Browse the repository at this point in the history
Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
  • Loading branch information
alenkacz committed Jul 28, 2020
1 parent 4ada4e2 commit 28421a0
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/integration/apply-delete-apply/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
name: configmap-operator-instance
spec:
operatorVersion:
name: configmap-operator-instance-0.1.0
status:
planStatus:
deploy:
status: COMPLETE
8 changes: 8 additions & 0 deletions test/integration/apply-delete-apply/00-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# this is a test covering regression described in #1596
# there was a race in apply-delete-apply where cache was not invalidated between delete and second apply
# as a result configmap did not exist at the end of plan
apiVersion: kudo.dev/v1beta1
kind: TestStep
commands:
- command: kubectl kudo install --instance configmap-instance ./operator
namespaced: true
6 changes: 6 additions & 0 deletions test/integration/apply-delete-apply/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kudo.dev/v1beta1
kind: ConfigMap
metadata:
name: test-configmap
data:
foo: bar
42 changes: 42 additions & 0 deletions test/integration/apply-delete-apply/operator/operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: kudo.dev/v1beta1
name: "configmap-operator"
operatorVersion: "0.1.0"
appVersion: "1.7.9"
kubernetesVersion: 1.13.0
maintainers:
- name: Your name
email: <your@email.com>
url: https://kudo.dev
tasks:
- name: apply
kind: Apply
spec:
resources:
- configmap.yaml
- name: delete
kind: Delete
spec:
resources:
- configmap.yaml
plans:
deploy:
strategy: serial
phases:
- name: main
strategy: serial
steps:
- name: apply
tasks:
- apply
- name: delete
strategy: serial
steps:
- name: delete
tasks:
- delete
- name: apply
strategy: serial
steps:
- name: apply
tasks:
- apply
5 changes: 5 additions & 0 deletions test/integration/apply-delete-apply/operator/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kudo.dev/v1beta1
parameters:
- name: replicas
description: Number of replicas that should be run as part of the deployment
default: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: test-configmap
data:
foo: bar

0 comments on commit 28421a0

Please sign in to comment.