-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abort plan with FATAL_ERROR if an unknown custom resource deployed (#…
…1648) * Abort plan with FATAL_ERROR if an unknown custom resource is going to be deployed. * Add health check for CRDs so they can deployed correctly before next step Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
- Loading branch information
1 parent
6b10260
commit b8f7233
Showing
11 changed files
with
421 additions
and
350 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
6 changes: 3 additions & 3 deletions
6
...n/operator-with-custom-crd/01-assert.yaml → ...ration/invalid-crd-install/00-assert.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Instance | ||
metadata: | ||
name: crd-instance | ||
name: op-with-crd | ||
spec: | ||
operatorVersion: | ||
name: crd-operator-0.1.0 | ||
name: op-with-crd-0.1.0 | ||
status: | ||
planStatus: | ||
deploy: | ||
status: COMPLETE | ||
status: FATAL_ERROR |
2 changes: 1 addition & 1 deletion
2
.../operator-with-custom-crd/01-install.yaml → ...ation/invalid-crd-install/00-install.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl kudo install --instance crd-instance ./operator | ||
- command: kubectl kudo install --instance op-with-crd ./op-with-crd | ||
namespaced: true |
25 changes: 25 additions & 0 deletions
25
test/integration/invalid-crd-install/op-with-crd/operator.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,25 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
name: "op-with-crd" | ||
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: app | ||
kind: Apply | ||
spec: | ||
resources: | ||
- invalid-crd.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,2 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
parameters: |
9 changes: 9 additions & 0 deletions
9
test/integration/invalid-crd-install/op-with-crd/templates/invalid-crd.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,9 @@ | ||
apiVersion: somecrd.invalid/v1 | ||
kind: InvalidCrdType | ||
metadata: | ||
name: {{ .Name }}-resource | ||
namespace: {{ .Namespace }} | ||
spec: | ||
this: | ||
does-not: "matter" | ||
there-is-no: "such-crd" |
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 |
---|---|---|
@@ -1,4 +1,16 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: servicemonitors.monitoring.coreos.com | ||
name: servicemonitors.monitoring.coreos.com | ||
--- | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Instance | ||
metadata: | ||
name: crd-instance | ||
spec: | ||
operatorVersion: | ||
name: crd-operator-0.1.0 | ||
status: | ||
planStatus: | ||
deploy: | ||
status: COMPLETE |
Oops, something went wrong.