From 4b0afaf64b21704f7de25639faa0812528464439 Mon Sep 17 00:00:00 2001 From: Karthik Satchitanand Date: Sat, 15 May 2021 20:19:33 +0530 Subject: [PATCH] [Cherry-Pick for 1.13.5] (#362) * chore(crds): updating the crds (#359) Signed-off-by: shubhamchaudhary * chore(annotation): converting default annotation check to false (#360) Signed-off-by: shubhamchaudhary * crds(validation): Adding openapi validation for tolerations (#363) Signed-off-by: shubhamchaudhary Co-authored-by: Shubham Chaudhary --- deploy/chaos_crds.yaml | 65 ++++++++++++++++++++++++++-- deploy/crds/chaosengine_crd.yaml | 63 +++++++++++++++++++++++++-- deploy/crds/chaosexperiment_crd.yaml | 2 +- pkg/controller/types/types.go | 2 +- 4 files changed, 123 insertions(+), 9 deletions(-) diff --git a/deploy/chaos_crds.yaml b/deploy/chaos_crds.yaml index a24497d65..e59f61de5 100644 --- a/deploy/chaos_crds.yaml +++ b/deploy/chaos_crds.yaml @@ -74,7 +74,7 @@ spec: type: type: string pattern: ^(go)$ - runnerAnnotation: + runnerAnnotations: type: object additionalProperties: type: string @@ -85,6 +85,29 @@ spec: value: type: string minLength: 1 + tolerations: + description: Pod's tolerations. + items: + description: The pod with this Toleration tolerates any taint matches the using the matching operator . + properties: + effect: + description: Effect to match. Empty means all effects. + type: string + key: + description: Taint key the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists. + type: string + operator: + description: Operators are Exists or Equal. Defaults to Equal. + type: string + tolerationSeconds: + description: Period of time the toleration tolerates the taint. + format: int64 + type: integer + value: + description: If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + type: object + type: array experiments: type: array items: @@ -227,6 +250,7 @@ spec: data: type: string components: + x-kubernetes-preserve-unknown-fields: true type: object properties: statusCheckTimeouts: @@ -238,7 +262,17 @@ spec: type: integer nodeSelector: type: object - minLength: 1 + additionalProperties: + type: string + properties: + key: + type: string + minLength: 1 + allowEmptyValue: false + value: + type: string + minLength: 1 + allowEmptyValue: false experimentImage: type: string env: @@ -374,7 +408,7 @@ spec: type: string mountPath: type: string - experimentAnnotation: + experimentAnnotations: type: object additionalProperties: type: string @@ -387,6 +421,29 @@ spec: type: string minLength: 1 allowEmptyValue: false + tolerations: + description: Pod's tolerations. + items: + description: The pod with this Toleration tolerates any taint matches the using the matching operator . + properties: + effect: + description: Effect to match. Empty means all effects. + type: string + key: + description: Taint key the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists. + type: string + operator: + description: Operators are Exists or Equal. Defaults to Equal. + type: string + tolerationSeconds: + description: Period of time the toleration tolerates the taint. + format: int64 + type: integer + value: + description: If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + type: object + type: array status: x-kubernetes-preserve-unknown-fields: true @@ -435,10 +492,10 @@ spec: x-kubernetes-preserve-unknown-fields: true type: object spec: - x-kubernetes-preserve-unknown-fields: true type: object properties: definition: + x-kubernetes-preserve-unknown-fields: true type: object properties: args: diff --git a/deploy/crds/chaosengine_crd.yaml b/deploy/crds/chaosengine_crd.yaml index 5e8e358d7..46b7a9806 100644 --- a/deploy/crds/chaosengine_crd.yaml +++ b/deploy/crds/chaosengine_crd.yaml @@ -73,7 +73,7 @@ spec: type: type: string pattern: ^(go)$ - runnerAnnotation: + runnerAnnotations: type: object additionalProperties: type: string @@ -84,6 +84,29 @@ spec: value: type: string minLength: 1 + tolerations: + description: Pod's tolerations. + items: + description: The pod with this Toleration tolerates any taint matches the using the matching operator . + properties: + effect: + description: Effect to match. Empty means all effects. + type: string + key: + description: Taint key the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists. + type: string + operator: + description: Operators are Exists or Equal. Defaults to Equal. + type: string + tolerationSeconds: + description: Period of time the toleration tolerates the taint. + format: int64 + type: integer + value: + description: If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + type: object + type: array experiments: type: array items: @@ -226,6 +249,7 @@ spec: data: type: string components: + x-kubernetes-preserve-unknown-fields: true type: object properties: statusCheckTimeouts: @@ -237,7 +261,17 @@ spec: type: integer nodeSelector: type: object - minLength: 1 + additionalProperties: + type: string + properties: + key: + type: string + minLength: 1 + allowEmptyValue: false + value: + type: string + minLength: 1 + allowEmptyValue: false experimentImage: type: string env: @@ -373,7 +407,7 @@ spec: type: string mountPath: type: string - experimentAnnotation: + experimentAnnotations: type: object additionalProperties: type: string @@ -386,6 +420,29 @@ spec: type: string minLength: 1 allowEmptyValue: false + tolerations: + description: Pod's tolerations. + items: + description: The pod with this Toleration tolerates any taint matches the using the matching operator . + properties: + effect: + description: Effect to match. Empty means all effects. + type: string + key: + description: Taint key the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists. + type: string + operator: + description: Operators are Exists or Equal. Defaults to Equal. + type: string + tolerationSeconds: + description: Period of time the toleration tolerates the taint. + format: int64 + type: integer + value: + description: If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + type: object + type: array status: x-kubernetes-preserve-unknown-fields: true diff --git a/deploy/crds/chaosexperiment_crd.yaml b/deploy/crds/chaosexperiment_crd.yaml index 6143bea21..0d48b361b 100644 --- a/deploy/crds/chaosexperiment_crd.yaml +++ b/deploy/crds/chaosexperiment_crd.yaml @@ -36,10 +36,10 @@ spec: x-kubernetes-preserve-unknown-fields: true type: object spec: - x-kubernetes-preserve-unknown-fields: true type: object properties: definition: + x-kubernetes-preserve-unknown-fields: true type: object properties: args: diff --git a/pkg/controller/types/types.go b/pkg/controller/types/types.go index d446a76f6..abe7f0bb0 100644 --- a/pkg/controller/types/types.go +++ b/pkg/controller/types/types.go @@ -44,7 +44,7 @@ var ( AppLabelKey string // DefaultAnnotationCheck contains the default value (true) of the annotationCheck - DefaultAnnotationCheck = "true" + DefaultAnnotationCheck = "false" // AppLabelValue contains the application label value AppLabelValue string