Skip to content
Snippets Groups Projects
Commit 711ffe88 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4453 OZG-4671 create crd/rbac

parent 675be6c5
No related branches found
No related tags found
No related merge requests found
Showing
with 419 additions and 0 deletions
#!/bin/sh
set -e
helm template ./src/main/helm/ -f src/test/helm/linter_values.yaml
helm lint -f src/test/helm/linter_values.yaml ./src/main/helm/
cd src/main/helm && helm unittest --helm3 -f '../../test/helm/*/*.yaml' -f '../../test/helm/*.yaml' .
apiVersion: v2
name: ozgcloud-elastic-operator
description: OZG Cloud Elastic Operator
type: application
version: 0.0.0-MANAGED-BY-JENKINS
appVersion: "0.0.0-MANAGED-BY-JENKINS"
icon: https://simpleicons.org/icons/helm.svg
\ No newline at end of file
# Muss die Datei so benannt werden?
--- #TOASK Werden die gebraucht?!
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: ozgcloudelasticuser.operator.ozgcloud.de
spec:
group: operator.ozgcloud.de
names:
kind: OzgCloudElasticUser
listKind: OzgCloudElasticUserList
plural: ozgelasticusers
singular: ozgelasticuser
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
description: OzgCloudElasticUser is the Schema for the keycloaks API
properties:
apiVersion:
description: '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'
type: string
kind:
type: string
description: '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'
metadata:
type: object
spec:
description: Spec defines the desired state of Elastic
type: object
x-kubernetes-preserve-unknown-fields: true
status:
description: Status defines the observed state of Elastic
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
subresources:
status: {}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: elastic-edit-role
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: elastic-edit-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ozgcloud-operator
app.kubernetes.io/part-of: ozgcloud-operator
app.kubernetes.io/managed-by: kustomize
rules:
- apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches/status
verbs:
- get
\ No newline at end of file
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: elastic-view-role
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: elastic-view-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: ozgcloud-operator
app.kubernetes.io/part-of: ozgcloud-operator
app.kubernetes.io/managed-by: kustomize
rules:
- apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches
verbs:
- get
- list
- watch
- apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches/status
verbs:
- get
\ No newline at end of file
suite: operator.ozgcloud.de_OzgCloudElasticUser test
templates:
- templates/crd/operator.ozgcloud.de_OzgCloudElasticUser.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: ozgcloudelasticuser.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: OzgCloudElasticUser
- it: should have spec names listKind
asserts:
- equal:
path: spec.names.listKind
value: OzgCloudElasticUserList
- it: should have spec names plural
asserts:
- equal:
path: spec.names.plural
value: ozgelasticusers
- it: should have spec names singular
asserts:
- equal:
path: spec.names.singular
value: ozgelasticuser
- it: should have spec scope
asserts:
- equal:
path: spec.scope
value: Namespaced
\ No newline at end of file
suite: operator.ozgcloud.de_OzgCloudElasticUser versions v1 test
templates:
- templates/crd/operator.ozgcloud.de_OzgCloudElasticUser.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: OzgCloudElasticUser 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 Elastic
- 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 Elastic
- 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
suite: elastic_edit_role test
templates:
- templates/rbac/elastic_edit_role.yaml
tests:
- it: should have apiVersion
asserts:
- equal:
path: apiVersion
value: rbac.authorization.k8s.io/v1
- it: should have isKind of
asserts:
- isKind:
of: ClusterRole
- it: should have metadata name
asserts:
- equal:
path: metadata.name
value: elastic-edit-role
- it: should have metadata labels name
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/name]
value: clusterrole
- it: should have metadata labels instance
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/instance]
value: elastic-edit-role
- it: should have metadata labels component
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/component]
value: rbac
- it: should have metadata labels created-by
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/created-by]
value: ozgcloud-operator
- it: should have metadata labels part-of
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/part-of]
value: ozgcloud-operator
- it: should have metadata labels managed-by
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/managed-by]
value: kustomize
- it: should have rules for ozgcloudelasticsearches resource
asserts:
- contains:
path: rules
content:
apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- it: should have rules for ozgcloudelasticsearches/status resource
asserts:
- contains:
path: rules
content:
apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches/status
verbs:
- get
\ No newline at end of file
suite: elastic_view_role test
templates:
- templates/rbac/elastic_view_role.yaml
tests:
- it: should have apiVersion
asserts:
- equal:
path: apiVersion
value: rbac.authorization.k8s.io/v1
- it: should have isKind of
asserts:
- isKind:
of: ClusterRole
- it: should have metadata name
asserts:
- equal:
path: metadata.name
value: elastic-view-role
- it: should have metadata labels name
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/name]
value: clusterrole
- it: should have metadata labels instance
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/instance]
value: elastic-view-role
- it: should have metadata labels component
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/component]
value: rbac
- it: should have metadata labels created-by
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/created-by]
value: ozgcloud-operator
- it: should have metadata labels part-of
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/part-of]
value: ozgcloud-operator
- it: should have metadata labels managed-by
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/managed-by]
value: kustomize
- it: should have rules for ozgcloudelasticsearches resource
asserts:
- contains:
path: rules
content:
apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches
verbs:
- get
- list
- watch
- it: should have rules for ozgcloudelasticsearches/status resource
asserts:
- contains:
path: rules
content:
apiGroups:
- api.ozgcloud-stack.de
resources:
- ozgcloudelasticsearches/status
verbs:
- get
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment