diff --git a/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml b/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml index e4b3820a25467fb8faeec61a5b75be8d5ef06c99..f35d5cb136dcbf0dfd1994ce7badbbd8eefd325c 100644 --- a/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml +++ b/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml @@ -2,7 +2,3 @@ image: repo: docker.ozg-sh.de -elasticsearch: - namespace: elastic-system - adminSecretName: ozg-search-cluster-es-elastic-user - certificateSecretName: ozg-search-cluster-es-http-ca-internal diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml index 83ece1c08bd44bc06afaa631215dcf699fd33239..874ac81be33b6ee09d036fff685c76223431cd16 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml @@ -32,6 +32,8 @@ tests: asserts: - isKind: of: ConfigMap + - isAPIVersion: + of: v1 - equal: path: metadata.name value: bindings-type diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml index 462e66f312dc001e037e1684545c168375caead4..a2ce802ba471d3cdf141cad0ca8a0ed2627383fb 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml @@ -28,13 +28,17 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: validate image type and container image - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].name @@ -47,11 +51,6 @@ tests: value: Always - it: validate health checks - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].readinessProbe @@ -78,11 +77,6 @@ tests: timeoutSeconds: 5 - it: validate security context - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].securityContext diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml similarity index 88% rename from ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_test.yaml rename to ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml index 0179c95b140f6f2cbdf14fb0ebb7a0576da5f807..49a663bb9a2b058aba7e0f920c5b49bc708e0196 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml @@ -25,9 +25,13 @@ suite: test environments templates: - templates/deployment.yaml +set: + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: check customList - template: deployment.yaml set: env.customList: - name: my_test_environment_name diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml index 720c45214a107a9ab442a31619bc1317a15a7933..2a9a1363c8e3a45ec43b9edeaf01560bfcc8949e 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml @@ -28,6 +28,11 @@ release: namespace: sh-helm-test templates: - templates/deployment.yaml +set: + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: check matchlabels set: diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml index fa5662446d960e6f468552a9caed3f8bdde19067..ac3b5f3acce32100f3681504437028aaf0e17792 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml @@ -28,42 +28,35 @@ release: namespace: sh-helm-test templates: - templates/deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal + tests: - it: check metadata labels - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: - path: metadata.labels["app.kubernetes.io/instance"] - value: ozgcloud-elasticsearch-operator - - equal: - path: metadata.labels["app.kubernetes.io/name"] - value: ozgcloud-elasticsearch-operator - - equal: - path: metadata.labels["app.kubernetes.io/part-of"] - value: ozg - - equal: - path: metadata.labels["app.kubernetes.io/namespace"] - value: sh-helm-test + path: metadata.labels + value: + app.kubernetes.io/instance: ozgcloud-elasticsearch-operator + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: ozgcloud-elasticsearch-operator + app.kubernetes.io/namespace: sh-helm-test + app.kubernetes.io/part-of: ozg + app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS + helm.sh/chart: ozgcloud-elasticsearch-operator-0.0.0-MANAGED-BY-JENKINS - it: check metadata name - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: metadata.name value: ozgcloud-elasticsearch-operator - it: check metadata namespace - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: metadata.namespace diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml index 983d2758b0eb06d149ad1b11264cf07890566517..b7da864872833c49a066c7d2a4f662772db6de14 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml @@ -28,6 +28,11 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: validate image pull secret resource name set: diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml index 5e871d26719f7d886e29729a2134f75419fd4aae..c6ad869259b723822ff15ca0bbdda13582f45132 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml @@ -27,6 +27,15 @@ release: name: afm-adapter templates: - templates/deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: test resources set: @@ -37,10 +46,6 @@ tests: requests: cpu: "33m" memory: "44Mi" - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].resources.limits.cpu @@ -56,11 +61,6 @@ tests: value: 44Mi - it: test empty resources - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - isEmpty: path: spec.template.spec.containers[0].resources diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml index 8ec9dbacd2267f9b2579ca4c5e2e57330edf10f6..e451cbdf643fc33f88174ed50e9c405953028c10 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml @@ -28,39 +28,47 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: validate serviceaccount name - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.serviceAccountName value: ozgcloud-elasticsearch-operator-serviceaccount - it: validate restartPolicy - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.restartPolicy value: Always - it: validate dns config - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.dnsConfig value: {} - equal: path: spec.template.spec.dnsPolicy - value: ClusterFirst \ No newline at end of file + value: ClusterFirst + - it: should have correct values for container terminationMessagePolicy, terminationMessagePath, stdin, tty + asserts: + - equal: + path: spec.template.spec.containers[0].terminationMessagePolicy + value: File + - equal: + path: spec.template.spec.containers[0].terminationMessagePath + value: /dev/termination-log + - equal: + path: spec.template.spec.containers[0].stdin + value: true + - equal: + path: spec.template.spec.containers[0].tty + value: true \ No newline at end of file diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml index e992e29f94ea59c82a59b616a7db948864061c56..5da0372294deaf7559a883e90f0b477e0903449c 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml @@ -28,13 +28,17 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: validate template type and api Version - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - isKind: of: Deployment diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml similarity index 86% rename from ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes.yaml rename to ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml index 15ce39bf9a4c2bafc6f15c13bb54a9e86c3e4c37..1130519b7dc99e4cdb95c866ba744fe3f05ecead 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml @@ -22,19 +22,24 @@ # unter der Lizenz sind dem Lizenztext zu entnehmen. # -suite: deployment type test +suite: deployment volumes test release: name: elastic-test-operator namespace: sh-helm-test templates: - - deployment.yaml + - templates/deployment.yaml + +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: should create SERVICE_BINDING_ROOT - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - contains: path: spec.template.spec.containers[0].env @@ -43,11 +48,6 @@ tests: value: "/bindings" - it: should create volumes - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - contains: path: spec.template.spec.volumes @@ -64,11 +64,6 @@ tests: optional: false - it: should create volumeMounts - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - contains: path: spec.template.spec.containers[0].volumeMounts diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml index aab55aca7ad1c21dbc0730aa82a28e0b3d8d872b..1054323861607423a1e515c062455cc4c9c30509 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml @@ -5,7 +5,7 @@ image: imagePullSecret: "docker-secret" -env: - customList: - - name: my_test_environment_name - value: "A test value" \ No newline at end of file +elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal \ No newline at end of file diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml index 9604c57257fe009fdb987fb9ab9ca673da1c1344..e24ec69b623056400e8b6155d8c0c481e8aabfe5 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml @@ -28,6 +28,11 @@ release: namespace: test-namespace templates: - templates/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role.yaml +set: + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: should have apiVersion asserts: diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml index 9cde6cc508e89f8f45d7f5afa55737d94783c826..84c52750bb38435c3002ae3af11b23a9b44d5da0 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml @@ -28,6 +28,11 @@ release: namespace: sh-helm-test templates: - templates/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding.yaml +set: + elasticsearch: + namespace: elastic-system + adminSecretName: ozg-search-cluster-es-elastic-user + certificateSecretName: ozg-search-cluster-es-http-ca-internal tests: - it: should have apiVersion asserts: diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml index c2a93ca53960bf57424ff9d3f153e5cfbecb9a43..e52b66866a9b63042b848a5fd8b19ea8dac0e195 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml @@ -33,6 +33,8 @@ tests: asserts: - isKind: of: ServiceAccount + - isAPIVersion: + of: v1 - equal: path: metadata.name value: ozgcloud-elasticsearch-operator-serviceaccount 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 0000000000000000000000000000000000000000..a1ac4ab3af2892293830a3657db9fc5711ab5bc6 --- /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_versions_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_versions_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3c36261a0532338ae6a05ef23c8111cf79bb2d60 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakClient_versions_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 0000000000000000000000000000000000000000..b5265fe0193272378e9fcbba3db10eb7bfabc620 --- /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_versions_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_versions_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f406e17a709cfc160458ee8599775ff20a2533f4 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakGroup_versions_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 0000000000000000000000000000000000000000..6ec3b43b2f87a089245b2f19d8c97b7e0d73cd26 --- /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_versions_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_versions_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4dd0be2d8205a1042bb2fe928c5d7aecf9d6b8c9 --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakRealms_versions_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 0000000000000000000000000000000000000000..6070502c7817448a014c20b225fb21a2c7a6b9d8 --- /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_versions_test.yaml b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_versions_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..813ebca1ff030b40aa0922c683ae825ddcc5c82a --- /dev/null +++ b/ozgcloud-keycloak-operator/src/test/helm/crds/operator.ozgcloud.de_OzgKeycloakUser_versions_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 2da4dfc05c5f5f7cdd60faa4c9d9ff0302830dd0..55882a09d7a3da3ee0a9ce963dc9d3f47b2613b0 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 a7884b3e122395bcad9c173e37c7b6de83af13eb..3c893f8ae21e47cd45df3479987d22f43b9a6534 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 813f199388e66967dee55efbd0bf32c34764dcc0..22e4a1db37fc246858b7d0373e5da12a6f877187 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 eee9267b9a323dbc363d870a0bbb3f33f0ec4724..41f2e531631f376382cf19fe5071ca2bdb6abea8 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 01112af2c2b3640468ce8eebce2358f9a8ad78b4..8902036dab84d8957b6661b739b87c5c512d5a72 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 11f427f1ff91273127e800e23d35841214495454..03891b465b8959cf8104b6aa5b816e453edd6175 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 f8110ec01bf2299ea649c18728675592e7a7f1b8..d8275ef581a686fa0c5812eca0a2de7953bc9409 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 2a52cf0982d275a62256ead45acc6475bfd94630..641ba7dfb8a4d75561bc51f995363c7861ee68a7 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 98fe2eb9243a9126110b42fc7b6e36a3881aa5f3..d1970b4272529918ba3901937b7d697afeceb3bf 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