From b31b24934e1c97b3284ebeb0625afb881b1b3905 Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Wed, 3 Apr 2024 18:57:47 +0200 Subject: [PATCH] OZG-3328 cleanup and add helm tests for keycloak operator --- ...or.ozgcloud.de_OzgKeycloakClient_test.yaml | 51 ++++++++++ ...ozgcloud.de_OzgKeycloakClient_v1_test.yaml | 97 ++++++++++++++++++ ...tor.ozgcloud.de_OzgKeycloakGroup_test.yaml | 51 ++++++++++ ....ozgcloud.de_OzgKeycloakGroup_v1_test.yaml | 97 ++++++++++++++++++ ...or.ozgcloud.de_OzgKeycloakRealms_test.yaml | 51 ++++++++++ ...ozgcloud.de_OzgKeycloakRealms_v1_test.yaml | 97 ++++++++++++++++++ ...ator.ozgcloud.de_OzgKeycloakUser_test.yaml | 51 ++++++++++ ...r.ozgcloud.de_OzgKeycloakUser_v1_test.yaml | 98 +++++++++++++++++++ .../src/test/helm/deployment_env_test.yaml | 6 +- .../helm/deployment_matchlabels_test.yaml | 7 +- .../helm/deployment_metadata_labels_test.yaml | 7 +- .../helm/deployment_pull_secret_test.yaml | 10 +- .../test/helm/deployment_resources_test.yaml | 6 +- .../src/test/helm/deployment_test.yaml | 9 +- .../keycloak_admin_secret_read_test.yaml | 4 + .../test/helm/rbacs/keycloak_read_test.yaml | 4 + .../test/helm/rbacs/keycloak_write_test.yaml | 4 + 17 files changed, 627 insertions(+), 23 deletions(-) create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_test.yaml create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_v1_test.yaml create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_test.yaml create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_v1_test.yaml create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_test.yaml create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_v1_test.yaml create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_test.yaml create mode 100644 ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_v1_test.yaml diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_test.yaml new file mode 100644 index 0000000..a1ac4ab --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_test.yaml @@ -0,0 +1,51 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakClient test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakClient.yaml +tests: + - it: should have apiVersion + asserts: + - equal: + path: apiVersion + value: apiextensions.k8s.io/v1 + - it: should have isKind of + asserts: + - isKind: + of: CustomResourceDefinition + + - it: should have metadata name + asserts: + - equal: + path: metadata.name + value: ozgcloudkeycloakclients.operator.ozgcloud.de + + - it: should have spec group + asserts: + - equal: + path: spec.group + value: operator.ozgcloud.de + - it: should have spec names kind + asserts: + - equal: + path: spec.names.kind + value: OzgCloudKeycloakClient + - it: should have spec names listKind + asserts: + - equal: + path: spec.names.listKind + value: OzgCloudKeycloakClientList + - it: should have spec names plural + asserts: + - equal: + path: spec.names.plural + value: ozgcloudkeycloakclients + - it: should have spec names singular + asserts: + - equal: + path: spec.names.singular + value: ozgcloudkeycloakclient + + - it: should have spec scope + asserts: + - equal: + path: spec.scope + value: Namespaced \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_v1_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_v1_test.yaml new file mode 100644 index 0000000..3c36261 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_v1_test.yaml @@ -0,0 +1,97 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakClient versions v1 test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakClient.yaml +tests: + - it: should have versions name + asserts: + - equal: + path: spec.versions[0].name + value: v1 + - it: should have versions schema description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.description + value: OzgCloudKeycloakClient is the Schema for the keycloaks API + - it: should have versions schema type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.type + value: object + + - it: should have versions schema apiVersion property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.type + value: string + - it: should have versions schema apiVersion property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.description + value: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + + - it: should have versions schema kind property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.type + value: string + - it: should have versions schema kind property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.description + value: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + + - it: should have versions schema metadata + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.metadata.type + value: object + + - it: should have versions schema spec description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.description + value: Spec defines the desired state of Keycloak + - it: should have versions schema spec type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.type + value: object + - it: should have versions schema spec preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions schema status description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.description + value: Status defines the observed state of Keycloak + - it: should have versions schema status type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.type + value: object + - it: should have versions schema status preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions served + asserts: + - equal: + path: spec.versions[0].served + value: true + - it: should have versions storage + asserts: + - equal: + path: spec.versions[0].storage + value: true + - it: should have versions subresources statis + asserts: + - equal: + path: spec.versions[0].subresources.status + value: {} \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_test.yaml new file mode 100644 index 0000000..b5265fe --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_test.yaml @@ -0,0 +1,51 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakGroup test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakGroup.yaml +tests: + - it: should have apiVersion + asserts: + - equal: + path: apiVersion + value: apiextensions.k8s.io/v1 + - it: should have isKind of + asserts: + - isKind: + of: CustomResourceDefinition + + - it: should have metadata name + asserts: + - equal: + path: metadata.name + value: ozgcloudkeycloakgroups.operator.ozgcloud.de + + - it: should have spec group + asserts: + - equal: + path: spec.group + value: operator.ozgcloud.de + - it: should have spec names kind + asserts: + - equal: + path: spec.names.kind + value: OzgCloudKeycloakGroup + - it: should have spec names listKind + asserts: + - equal: + path: spec.names.listKind + value: OzgCloudKeycloakGroupList + - it: should have spec names plural + asserts: + - equal: + path: spec.names.plural + value: ozgcloudkeycloakgroups + - it: should have spec names singular + asserts: + - equal: + path: spec.names.singular + value: ozgcloudkeycloakgroup + + - it: should have spec scope + asserts: + - equal: + path: spec.scope + value: Namespaced \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_v1_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_v1_test.yaml new file mode 100644 index 0000000..f406e17 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_v1_test.yaml @@ -0,0 +1,97 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakGroup versions v1 test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakGroup.yaml +tests: + - it: should have versions name + asserts: + - equal: + path: spec.versions[0].name + value: v1 + - it: should have versions schema description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.description + value: OzgCloudKeycloakGroup is the Schema for the keycloaks API + - it: should have versions schema type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.type + value: object + + - it: should have versions schema apiVersion property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.type + value: string + - it: should have versions schema apiVersion property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.description + value: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + + - it: should have versions schema kind property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.type + value: string + - it: should have versions schema kind property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.description + value: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + + - it: should have versions schema metadata + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.metadata.type + value: object + + - it: should have versions schema spec description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.description + value: Spec defines the desired state of Keycloak + - it: should have versions schema spec type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.type + value: object + - it: should have versions schema spec preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions schema status description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.description + value: Status defines the observed state of Keycloak + - it: should have versions schema status type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.type + value: object + - it: should have versions schema status preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions served + asserts: + - equal: + path: spec.versions[0].served + value: true + - it: should have versions storage + asserts: + - equal: + path: spec.versions[0].storage + value: true + - it: should have versions subresources statis + asserts: + - equal: + path: spec.versions[0].subresources.status + value: {} \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_test.yaml new file mode 100644 index 0000000..6ec3b43 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_test.yaml @@ -0,0 +1,51 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakRealms test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakRealms.yaml +tests: + - it: should have apiVersion + asserts: + - equal: + path: apiVersion + value: apiextensions.k8s.io/v1 + - it: should have isKind of + asserts: + - isKind: + of: CustomResourceDefinition + + - it: should have metadata name + asserts: + - equal: + path: metadata.name + value: ozgcloudkeycloakrealms.operator.ozgcloud.de + + - it: should have spec group + asserts: + - equal: + path: spec.group + value: operator.ozgcloud.de + - it: should have spec names kind + asserts: + - equal: + path: spec.names.kind + value: OzgCloudKeycloakRealm + - it: should have spec names listKind + asserts: + - equal: + path: spec.names.listKind + value: OzgCloudKeycloakRealmList + - it: should have spec names plural + asserts: + - equal: + path: spec.names.plural + value: ozgcloudkeycloakrealms + - it: should have spec names singular + asserts: + - equal: + path: spec.names.singular + value: ozgcloudkeycloakrealm + + - it: should have spec scope + asserts: + - equal: + path: spec.scope + value: Namespaced \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_v1_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_v1_test.yaml new file mode 100644 index 0000000..4dd0be2 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_v1_test.yaml @@ -0,0 +1,97 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakRealms versions v1 test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakRealms.yaml +tests: + - it: should have versions name + asserts: + - equal: + path: spec.versions[0].name + value: v1 + - it: should have versions schema description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.description + value: OzgCloudKeycloakRealm is the Schema for the keycloak API + - it: should have versions schema type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.type + value: object + + - it: should have versions schema apiVersion property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.type + value: string + - it: should have versions schema apiVersion property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.description + value: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + + - it: should have versions schema kind property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.type + value: string + - it: should have versions schema kind property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.description + value: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + + - it: should have versions schema metadata + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.metadata.type + value: object + + - it: should have versions schema spec description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.description + value: Spec defines the desired state of Keycloak + - it: should have versions schema spec type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.type + value: object + - it: should have versions schema spec preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions schema status description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.description + value: Status defines the observed state of Keycloak + - it: should have versions schema status type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.type + value: object + - it: should have versions schema status preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions served + asserts: + - equal: + path: spec.versions[0].served + value: true + - it: should have versions storage + asserts: + - equal: + path: spec.versions[0].storage + value: true + - it: should have versions subresources statis + asserts: + - equal: + path: spec.versions[0].subresources.status + value: {} \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_test.yaml new file mode 100644 index 0000000..6070502 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_test.yaml @@ -0,0 +1,51 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakUser test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakUser.yaml +tests: + - it: should have apiVersion + asserts: + - equal: + path: apiVersion + value: apiextensions.k8s.io/v1 + - it: should have isKind of + asserts: + - isKind: + of: CustomResourceDefinition + + - it: should have metadata name + asserts: + - equal: + path: metadata.name + value: ozgcloudkeycloakusers.operator.ozgcloud.de + + - it: should have spec group + asserts: + - equal: + path: spec.group + value: operator.ozgcloud.de + - it: should have spec names kind + asserts: + - equal: + path: spec.names.kind + value: OzgCloudKeycloakUser + - it: should have spec names listKind + asserts: + - equal: + path: spec.names.listKind + value: OzgCloudKeycloakUserList + - it: should have spec names plural + asserts: + - equal: + path: spec.names.plural + value: ozgcloudkeycloakusers + - it: should have spec names singular + asserts: + - equal: + path: spec.names.singular + value: ozgcloudkeycloakuser + + - it: should have spec scope + asserts: + - equal: + path: spec.scope + value: Namespaced \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_v1_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_v1_test.yaml new file mode 100644 index 0000000..813ebca --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_v1_test.yaml @@ -0,0 +1,98 @@ +suite: operator.ozgcloud.de_OzgCloudKeycloakUser versions v1 test +templates: + - templates/crds/operator.ozgcloud.de_OzgKeycloakUser.yaml +tests: + - it: should have versions name + asserts: + - equal: + path: spec.versions[0].name + value: v1 + - it: should have versions schema description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.description + value: OzgCloudKeycloakUser is the Schema for the keycloaks API + - it: should have versions schema type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.type + value: object + + - it: should have versions schema apiVersion property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.type + value: string + - it: should have versions schema apiVersion property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.apiVersion.description + value: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + + - it: should have versions schema kind property type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.type + value: string + - it: should have versions schema kind property description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.kind.description + value: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + + + - it: should have versions schema metadata + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.metadata.type + value: object + + - it: should have versions schema spec description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.description + value: Spec defines the desired state of Keycloak + - it: should have versions schema spec type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.type + value: object + - it: should have versions schema spec preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.spec.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions schema status description + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.description + value: Status defines the observed state of Keycloak + - it: should have versions schema status type + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.type + value: object + - it: should have versions schema status preserve unknown fields + asserts: + - equal: + path: spec.versions[0].schema.openAPIV3Schema.properties.status.x-kubernetes-preserve-unknown-fields + value: true + + - it: should have versions served + asserts: + - equal: + path: spec.versions[0].served + value: true + - it: should have versions storage + asserts: + - equal: + path: spec.versions[0].storage + value: true + - it: should have versions subresources statis + asserts: + - equal: + path: spec.versions[0].subresources.status + value: {} \ No newline at end of file diff --git a/ozgcloud-keycloak-operator/src/test/helm/deployment_env_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/deployment_env_test.yaml index 2da4dfc..55882a0 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/deployment_env_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/deployment_env_test.yaml @@ -27,6 +27,9 @@ templates: - templates/deployment.yaml set: imagePullSecret: "docker-secret" + image: + name: hase + tag: latest tests: - it: check customList template: deployment.yaml @@ -34,9 +37,6 @@ tests: env.customList: - name: my_test_environment_name value: "A test value" - image: - name: hase - tag: latest asserts: - contains: path: spec.template.spec.containers[0].env diff --git a/ozgcloud-keycloak-operator/src/test/helm/deployment_matchlabels_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/deployment_matchlabels_test.yaml index a7884b3..3c893f8 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/deployment_matchlabels_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/deployment_matchlabels_test.yaml @@ -30,12 +30,11 @@ templates: - templates/deployment.yaml set: imagePullSecret: "docker-secret" + image: + name: hase + tag: latest tests: - it: check matchlabels - set: - image: - name: hase - tag: latest asserts: - equal: path: spec.selector.matchLabels["app.kubernetes.io/name"] diff --git a/ozgcloud-keycloak-operator/src/test/helm/deployment_metadata_labels_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/deployment_metadata_labels_test.yaml index 813f199..22e4a1d 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/deployment_metadata_labels_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/deployment_metadata_labels_test.yaml @@ -30,12 +30,11 @@ templates: - templates/deployment.yaml set: imagePullSecret: "docker-secret" + image: + name: hase + tag: latest tests: - it: check default labels - set: - image: - name: hase - tag: latest asserts: - equal: path: metadata.labels["app.kubernetes.io/name"] diff --git a/ozgcloud-keycloak-operator/src/test/helm/deployment_pull_secret_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/deployment_pull_secret_test.yaml index eee9267..41f2e53 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/deployment_pull_secret_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/deployment_pull_secret_test.yaml @@ -28,13 +28,13 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret tests: - it: validate image pull secret resource name - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.imagePullSecrets[0].name diff --git a/ozgcloud-keycloak-operator/src/test/helm/deployment_resources_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/deployment_resources_test.yaml index 01112af..8902036 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/deployment_resources_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/deployment_resources_test.yaml @@ -29,6 +29,9 @@ templates: - templates/deployment.yaml set: imagePullSecret: "docker-secret" + image: + name: hase + tag: latest tests: - it: test resources set: @@ -39,9 +42,6 @@ tests: requests: cpu: "33m" memory: "44Mi" - image: - name: hase - tag: latest asserts: - equal: path: spec.template.spec.containers[0].resources.limits.cpu diff --git a/ozgcloud-keycloak-operator/src/test/helm/deployment_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/deployment_test.yaml index 11f427f..03891b4 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/deployment_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/deployment_test.yaml @@ -30,15 +30,16 @@ templates: - deployment.yaml set: imagePullSecret: "docker-secret" + image: + name: hase + tag: latest tests: - it: validate image type and container image - set: - image: - name: hase - tag: latest asserts: - isKind: of: Deployment + - isAPIVersion: + of: apps/v1 - equal: path: spec.template.spec.containers[0].image value: docker.ozg-sh.de/hase:latest diff --git a/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_admin_secret_read_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_admin_secret_read_test.yaml index f8110ec..d8275ef 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_admin_secret_read_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_admin_secret_read_test.yaml @@ -34,6 +34,8 @@ tests: - isKind: of: RoleBinding documentIndex: 0 + - isAPIVersion: + of: rbac.authorization.k8s.io/v1 - equal: path: metadata.name value: ozgcloud-keycloak-operator-admin-secret-viewer-role-binding @@ -66,6 +68,8 @@ tests: - isKind: of: Role documentIndex: 1 + - isAPIVersion: + of: rbac.authorization.k8s.io/v1 - equal: path: metadata.name value: ozgcloud-keycloak-operator-admin-secret-viewer-role diff --git a/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_read_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_read_test.yaml index 2a52cf0..641ba7d 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_read_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_read_test.yaml @@ -34,6 +34,8 @@ tests: - isKind: of: ClusterRoleBinding documentIndex: 0 + - isAPIVersion: + of: rbac.authorization.k8s.io/v1 - equal: path: metadata.name value: ozgcloud-keycloak-operator-viewer-role-binding @@ -62,6 +64,8 @@ tests: - isKind: of: ClusterRole documentIndex: 1 + - isAPIVersion: + of: rbac.authorization.k8s.io/v1 - equal: path: metadata.name value: ozgcloud-keycloak-operator-viewer-role diff --git a/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_write_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_write_test.yaml index 98fe2eb..d1970b4 100644 --- a/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_write_test.yaml +++ b/ozgcloud-keycloak-operator/src/test/helm/rbacs/keycloak_write_test.yaml @@ -34,6 +34,8 @@ tests: - isKind: of: ClusterRoleBinding documentIndex: 0 + - isAPIVersion: + of: rbac.authorization.k8s.io/v1 - equal: path: metadata.name value: ozgcloud-keycloak-operator-write-role-binding @@ -62,6 +64,8 @@ tests: - isKind: of: ClusterRole documentIndex: 1 + - isAPIVersion: + of: rbac.authorization.k8s.io/v1 - equal: path: metadata.name value: ozgcloud-keycloak-operator-write-role -- GitLab