-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialise plan status correctly if an upgraded plan adds new phases …
…or steps (#1755) * Add e2e-test to confirm missing phase status bug * Initialize status correctly for newly added phases and steps Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
- Loading branch information
1 parent
63fbe53
commit 3c56293
Showing
14 changed files
with
248 additions
and
11 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
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
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
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,16 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Instance | ||
metadata: | ||
name: upgrade-operator | ||
status: | ||
conditions: | ||
- type: Ready | ||
status: "True" | ||
planStatus: | ||
deploy: | ||
status: COMPLETE | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment |
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,5 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl kudo install --instance upgrade-operator ./first-operator | ||
namespaced: 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,18 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Instance | ||
metadata: | ||
name: upgrade-operator | ||
status: | ||
planStatus: | ||
deploy: | ||
status: COMPLETE | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test |
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,5 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl kudo upgrade --instance upgrade-operator ./first-operator-v2 | ||
namespaced: 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,36 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
name: "first-operator" | ||
operatorVersion: "0.2.0" | ||
appVersion: "1.7.9" | ||
kubernetesVersion: 1.17.0 | ||
maintainers: | ||
- name: Your name | ||
email: <your@email.com> | ||
url: https://kudo.dev | ||
tasks: | ||
- name: app | ||
kind: Apply | ||
spec: | ||
resources: | ||
- deployment.yaml | ||
- name: config | ||
kind: Apply | ||
spec: | ||
resources: | ||
- configmap.yaml | ||
plans: | ||
deploy: | ||
strategy: serial | ||
phases: | ||
- name: newphase | ||
strategy: parallel | ||
steps: | ||
- name: config | ||
tasks: | ||
- config | ||
- name: main | ||
strategy: parallel | ||
steps: | ||
- name: everything | ||
tasks: | ||
- app |
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,5 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
parameters: | ||
- name: replicas | ||
description: Number of replicas that should be run as part of the deployment | ||
default: 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,6 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: test | ||
data: | ||
foo: bar |
19 changes: 19 additions & 0 deletions
19
test/e2e/upgrade/first-operator-v2/templates/deployment.yaml
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,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
replicas: {{ .Params.replicas }} # tells deployment to run 2 pods matching the template | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:{{ .AppVersion }} | ||
ports: | ||
- containerPort: 80 |
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,25 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
name: "first-operator" | ||
operatorVersion: "0.1.0" | ||
appVersion: "1.7.9" | ||
kubernetesVersion: 1.17.0 | ||
maintainers: | ||
- name: Your name | ||
email: <your@email.com> | ||
url: https://kudo.dev | ||
tasks: | ||
- name: app | ||
kind: Apply | ||
spec: | ||
resources: | ||
- deployment.yaml | ||
plans: | ||
deploy: | ||
strategy: serial | ||
phases: | ||
- name: main | ||
strategy: parallel | ||
steps: | ||
- name: everything | ||
tasks: | ||
- app |
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,5 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
parameters: | ||
- name: replicas | ||
description: Number of replicas that should be run as part of the deployment | ||
default: 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,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
replicas: {{ .Params.replicas }} # tells deployment to run 2 pods matching the template | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:{{ .AppVersion }} | ||
ports: | ||
- containerPort: 80 |