From fbae5cf590f964e0ca8deba548de3642fd171698 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Wed, 10 Feb 2021 21:12:24 +0100 Subject: [PATCH 1/4] CRD: Move to apiextensions.k8s.io/v1 --- ansible/templates/crd.yml.j2 | 19 +- deploy/awx-operator.yaml | 20 +- deploy/crds/awx_v1beta1_crd.yaml | 19 +- .../manifests/awx.ansible.com_awxs_crd.yaml | 186 +++++++++--------- 4 files changed, 125 insertions(+), 119 deletions(-) diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index 5f2c97d5..a5d4f1b7 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -1,5 +1,5 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: awxs.awx.ansible.com @@ -11,18 +11,17 @@ spec: plural: awxs singular: awx scope: Namespaced - subresources: - status: {} - version: v1beta1 versions: - name: v1beta1 served: true storage: true - validation: - openAPIV3Schema: - description: Schema validation for the AWX CRD - type: object - properties: - spec: + subresources: + status: {} + schema: + openAPIV3Schema: + description: Schema validation for the AWX CRD type: object properties: + spec: + type: object + properties: diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index aeb1faf2..4bb3f3cd 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -11,6 +11,7 @@ rules: - route.openshift.io resources: - routes + - routes/custom-host verbs: - '*' - apiGroups: @@ -139,7 +140,7 @@ spec: emptyDir: {} --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: awxs.awx.ansible.com @@ -151,18 +152,17 @@ spec: plural: awxs singular: awx scope: Namespaced - subresources: - status: {} - version: v1beta1 versions: - name: v1beta1 served: true storage: true - validation: - openAPIV3Schema: - description: Schema validation for the AWX CRD - type: object - properties: - spec: + subresources: + status: {} + schema: + openAPIV3Schema: + description: Schema validation for the AWX CRD type: object properties: + spec: + type: object + properties: diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index 5f2c97d5..a5d4f1b7 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: awxs.awx.ansible.com @@ -11,18 +11,17 @@ spec: plural: awxs singular: awx scope: Namespaced - subresources: - status: {} - version: v1beta1 versions: - name: v1beta1 served: true storage: true - validation: - openAPIV3Schema: - description: Schema validation for the AWX CRD - type: object - properties: - spec: + subresources: + status: {} + schema: + openAPIV3Schema: + description: Schema validation for the AWX CRD type: object properties: + spec: + type: object + properties: diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml index 5984c9d0..4ba53478 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml @@ -1,5 +1,5 @@ --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: creationTimestamp: null @@ -12,95 +12,103 @@ spec: plural: awxs singular: awx scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: Schema validation for the AWX CRD - properties: - spec: - properties: - tower_hostname: - description: The hostname of the instance - type: string - tower_admin_email: - description: The admin user email - type: string - tower_admin_password_secret: - description: Secret where the admin password can be found - type: string - tower_postgres_configuration_secret: - description: Secret where the database configuration can be found - type: string - tower_secret_key_secret: - description: Secret where the secret key can be found - type: string - tower_ingress_type: - description: The ingress type to use to reach the deployed instance - type: string - enum: - - none - - Ingress - - Route - tower_route_host: - description: The DNS to use to points to the instance - type: string - tower_route_tls_termination_mechanism: - description: The secure TLS termination mechanism to use - type: string - enum: - - Edge - - Passthrough - tower_route_tls_secret: - description: Secret where the TLS related credentials are stored - type: string - tower_image_pull_policy: - description: The image pull policy - type: string - enum: - - Always - - Never - - IfNotPresent - tower_task_resource_requirements: - description: Resource requirements for the task container - type: object - tower_web_resource_requirements: - description: Resource requirements for the web container - type: object - tower_replicas: - description: Number of instance replicas - type: integer - format: int32 - tower_garbage_collect_secrets: - description: Whether or not to remove secrets upon instance removal - type: boolean - tower_create_preload_data: - description: Whether or not to preload data upon Tower instance creation - type: boolean - type: object - status: - properties: - towerURL: - description: URL to access the deployed instance - type: string - towerAdminUser: - description: Admin user of the deployed instance - type: string - towerAdminPasswordSecret: - description: Admin password of the deployed instance - type: string - towerVersion: - description: Version of the deployed instance - type: string - type: object - version: v1beta1 versions: - name: v1beta1 served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: null + subresources: + status: {} + schema: + openAPIV3Schema: + description: Schema validation for the AWX CRD + properties: + spec: + properties: + tower_hostname: + description: The hostname of the instance + type: string + tower_admin_email: + description: The admin user email + type: string + tower_admin_password_secret: + description: Secret where the admin password can be found + type: string + tower_postgres_configuration_secret: + description: Secret where the database configuration can be found + type: string + tower_secret_key_secret: + description: Secret where the secret key can be found + type: string + tower_ingress_type: + description: The ingress type to use to reach the deployed instance + type: string + enum: + - none + - Ingress + - Route + tower_route_host: + description: The DNS to use to points to the instance + type: string + tower_route_tls_termination_mechanism: + description: The secure TLS termination mechanism to use + type: string + enum: + - Edge + - Passthrough + tower_route_tls_secret: + description: Secret where the TLS related credentials are stored + type: string + tower_image_pull_policy: + description: The image pull policy + type: string + enum: + - Always + - Never + - IfNotPresent + tower_task_resource_requirements: + description: Resource requirements for the task container + type: object + tower_web_resource_requirements: + description: Resource requirements for the web container + type: object + tower_replicas: + description: Number of instance replicas + type: integer + format: int32 + tower_garbage_collect_secrets: + description: Whether or not to remove secrets upon instance removal + type: boolean + tower_create_preload_data: + description: Whether or not to preload data upon Tower instance creation + type: boolean + type: object + status: + properties: + towerURL: + description: URL to access the deployed instance + type: string + towerAdminUser: + description: Admin user of the deployed instance + type: string + towerAdminPasswordSecret: + description: Admin password of the deployed instance + type: string + towerVersion: + description: Version of the deployed instance + type: string + conditions: + description: The resulting conditions when a Service Telemetry is instantiated + items: + properties: + status: + type: string + type: + type: string + reason: + type: string + lastTransitionTime: + type: string + type: object + type: array + type: object + type: object From a4ee609a761e480758fb0f2da6734845fc99fe78 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Wed, 10 Feb 2021 21:16:11 +0100 Subject: [PATCH 2/4] CRD: Add default value to openAPIV3Schema --- ansible/templates/crd.yml.j2 | 95 ++++++++++++++++++- deploy/awx-operator.yaml | 95 ++++++++++++++++++- deploy/crds/awx_v1beta1_crd.yaml | 95 ++++++++++++++++++- .../manifests/awx.ansible.com_awxs_crd.yaml | 5 + 4 files changed, 284 insertions(+), 6 deletions(-) diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index a5d4f1b7..f2a1995b 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -20,8 +20,99 @@ spec: schema: openAPIV3Schema: description: Schema validation for the AWX CRD - type: object properties: spec: - type: object properties: + tower_hostname: + description: The hostname of the instance + type: string + tower_admin_email: + description: The admin user email + type: string + tower_admin_password_secret: + description: Secret where the admin password can be found + type: string + tower_postgres_configuration_secret: + description: Secret where the database configuration can be found + type: string + tower_secret_key_secret: + description: Secret where the secret key can be found + type: string + tower_ingress_type: + description: The ingress type to use to reach the deployed instance + type: string + enum: + - none + - Ingress + - Route + tower_route_host: + description: The DNS to use to points to the instance + type: string + tower_route_tls_termination_mechanism: + description: The secure TLS termination mechanism to use + type: string + default: Edge + enum: + - Edge + - Passthrough + tower_route_tls_secret: + description: Secret where the TLS related credentials are stored + type: string + tower_image_pull_policy: + description: The image pull policy + type: string + default: IfNotPresent + enum: + - Always + - Never + - IfNotPresent + tower_task_resource_requirements: + description: Resource requirements for the task container + type: object + tower_web_resource_requirements: + description: Resource requirements for the web container + type: object + tower_replicas: + description: Number of instance replicas + type: integer + default: 1 + format: int32 + tower_garbage_collect_secrets: + description: Whether or not to remove secrets upon instance removal + default: false + type: boolean + tower_create_preload_data: + description: Whether or not to preload data upon Tower instance creation + default: true + type: boolean + type: object + status: + properties: + towerURL: + description: URL to access the deployed instance + type: string + towerAdminUser: + description: Admin user of the deployed instance + type: string + towerAdminPasswordSecret: + description: Admin password of the deployed instance + type: string + towerVersion: + description: Version of the deployed instance + type: string + conditions: + description: The resulting conditions when a Service Telemetry is instantiated + items: + properties: + status: + type: string + type: + type: string + reason: + type: string + lastTransitionTime: + type: string + type: object + type: array + type: object + type: object diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index 4bb3f3cd..690d3994 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -161,8 +161,99 @@ spec: schema: openAPIV3Schema: description: Schema validation for the AWX CRD - type: object properties: spec: - type: object properties: + tower_hostname: + description: The hostname of the instance + type: string + tower_admin_email: + description: The admin user email + type: string + tower_admin_password_secret: + description: Secret where the admin password can be found + type: string + tower_postgres_configuration_secret: + description: Secret where the database configuration can be found + type: string + tower_secret_key_secret: + description: Secret where the secret key can be found + type: string + tower_ingress_type: + description: The ingress type to use to reach the deployed instance + type: string + enum: + - none + - Ingress + - Route + tower_route_host: + description: The DNS to use to points to the instance + type: string + tower_route_tls_termination_mechanism: + description: The secure TLS termination mechanism to use + type: string + default: Edge + enum: + - Edge + - Passthrough + tower_route_tls_secret: + description: Secret where the TLS related credentials are stored + type: string + tower_image_pull_policy: + description: The image pull policy + type: string + default: IfNotPresent + enum: + - Always + - Never + - IfNotPresent + tower_task_resource_requirements: + description: Resource requirements for the task container + type: object + tower_web_resource_requirements: + description: Resource requirements for the web container + type: object + tower_replicas: + description: Number of instance replicas + type: integer + default: 1 + format: int32 + tower_garbage_collect_secrets: + description: Whether or not to remove secrets upon instance removal + default: false + type: boolean + tower_create_preload_data: + description: Whether or not to preload data upon Tower instance creation + default: true + type: boolean + type: object + status: + properties: + towerURL: + description: URL to access the deployed instance + type: string + towerAdminUser: + description: Admin user of the deployed instance + type: string + towerAdminPasswordSecret: + description: Admin password of the deployed instance + type: string + towerVersion: + description: Version of the deployed instance + type: string + conditions: + description: The resulting conditions when a Service Telemetry is instantiated + items: + properties: + status: + type: string + type: + type: string + reason: + type: string + lastTransitionTime: + type: string + type: object + type: array + type: object + type: object diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index a5d4f1b7..f2a1995b 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -20,8 +20,99 @@ spec: schema: openAPIV3Schema: description: Schema validation for the AWX CRD - type: object properties: spec: - type: object properties: + tower_hostname: + description: The hostname of the instance + type: string + tower_admin_email: + description: The admin user email + type: string + tower_admin_password_secret: + description: Secret where the admin password can be found + type: string + tower_postgres_configuration_secret: + description: Secret where the database configuration can be found + type: string + tower_secret_key_secret: + description: Secret where the secret key can be found + type: string + tower_ingress_type: + description: The ingress type to use to reach the deployed instance + type: string + enum: + - none + - Ingress + - Route + tower_route_host: + description: The DNS to use to points to the instance + type: string + tower_route_tls_termination_mechanism: + description: The secure TLS termination mechanism to use + type: string + default: Edge + enum: + - Edge + - Passthrough + tower_route_tls_secret: + description: Secret where the TLS related credentials are stored + type: string + tower_image_pull_policy: + description: The image pull policy + type: string + default: IfNotPresent + enum: + - Always + - Never + - IfNotPresent + tower_task_resource_requirements: + description: Resource requirements for the task container + type: object + tower_web_resource_requirements: + description: Resource requirements for the web container + type: object + tower_replicas: + description: Number of instance replicas + type: integer + default: 1 + format: int32 + tower_garbage_collect_secrets: + description: Whether or not to remove secrets upon instance removal + default: false + type: boolean + tower_create_preload_data: + description: Whether or not to preload data upon Tower instance creation + default: true + type: boolean + type: object + status: + properties: + towerURL: + description: URL to access the deployed instance + type: string + towerAdminUser: + description: Admin user of the deployed instance + type: string + towerAdminPasswordSecret: + description: Admin password of the deployed instance + type: string + towerVersion: + description: Version of the deployed instance + type: string + conditions: + description: The resulting conditions when a Service Telemetry is instantiated + items: + properties: + status: + type: string + type: + type: string + reason: + type: string + lastTransitionTime: + type: string + type: object + type: array + type: object + type: object diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml index 4ba53478..d279c18d 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml @@ -52,6 +52,7 @@ spec: tower_route_tls_termination_mechanism: description: The secure TLS termination mechanism to use type: string + default: Edge enum: - Edge - Passthrough @@ -61,6 +62,7 @@ spec: tower_image_pull_policy: description: The image pull policy type: string + default: IfNotPresent enum: - Always - Never @@ -74,12 +76,15 @@ spec: tower_replicas: description: Number of instance replicas type: integer + default: 1 format: int32 tower_garbage_collect_secrets: description: Whether or not to remove secrets upon instance removal + default: false type: boolean tower_create_preload_data: description: Whether or not to preload data upon Tower instance creation + default: true type: boolean type: object status: From a39b9149636249e697329e063ff65ffcaa32a67b Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Wed, 10 Feb 2021 22:48:58 +0100 Subject: [PATCH 3/4] CI: Bump bsycorp/kind to v1.17.9 --- molecule/test-local/molecule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/test-local/molecule.yml b/molecule/test-local/molecule.yml index eecb6ef6..f534ed46 100644 --- a/molecule/test-local/molecule.yml +++ b/molecule/test-local/molecule.yml @@ -11,7 +11,7 @@ platforms: - name: kind-test-local groups: - k8s - image: bsycorp/kind:latest-1.15 + image: bsycorp/kind:v1.17.9 privileged: True override_command: no exposed_ports: From 25fc21a6cd309b90ffc8ecf681f8ac8e460c36b4 Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Wed, 10 Feb 2021 23:02:14 +0100 Subject: [PATCH 4/4] Enum: allow various casing --- ansible/templates/crd.yml.j2 | 7 +++++++ deploy/awx-operator.yaml | 7 +++++++ deploy/crds/awx_v1beta1_crd.yaml | 7 +++++++ .../awx-operator/manifests/awx.ansible.com_awxs_crd.yaml | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index f2a1995b..a15f6418 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -44,7 +44,9 @@ spec: enum: - none - Ingress + - ingress - Route + - route tower_route_host: description: The DNS to use to points to the instance type: string @@ -54,7 +56,9 @@ spec: default: Edge enum: - Edge + - edge - Passthrough + - passthrough tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string @@ -64,8 +68,11 @@ spec: default: IfNotPresent enum: - Always + - always - Never + - never - IfNotPresent + - ifnotpresent tower_task_resource_requirements: description: Resource requirements for the task container type: object diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index 690d3994..1ecca475 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -185,7 +185,9 @@ spec: enum: - none - Ingress + - ingress - Route + - route tower_route_host: description: The DNS to use to points to the instance type: string @@ -195,7 +197,9 @@ spec: default: Edge enum: - Edge + - edge - Passthrough + - passthrough tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string @@ -205,8 +209,11 @@ spec: default: IfNotPresent enum: - Always + - always - Never + - never - IfNotPresent + - ifnotpresent tower_task_resource_requirements: description: Resource requirements for the task container type: object diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index f2a1995b..a15f6418 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -44,7 +44,9 @@ spec: enum: - none - Ingress + - ingress - Route + - route tower_route_host: description: The DNS to use to points to the instance type: string @@ -54,7 +56,9 @@ spec: default: Edge enum: - Edge + - edge - Passthrough + - passthrough tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string @@ -64,8 +68,11 @@ spec: default: IfNotPresent enum: - Always + - always - Never + - never - IfNotPresent + - ifnotpresent tower_task_resource_requirements: description: Resource requirements for the task container type: object diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml index d279c18d..9d37d807 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml @@ -45,7 +45,9 @@ spec: enum: - none - Ingress + - ingress - Route + - route tower_route_host: description: The DNS to use to points to the instance type: string @@ -55,7 +57,9 @@ spec: default: Edge enum: - Edge + - edge - Passthrough + - passthrough tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string @@ -65,8 +69,11 @@ spec: default: IfNotPresent enum: - Always + - always - Never + - never - IfNotPresent + - ifnotpresent tower_task_resource_requirements: description: Resource requirements for the task container type: object