[bitnami/rabbitmq-cluster-operator] add missing operatorpolicies crd (#23037)

* add missing crd

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>

* add missing rbac for operatorpolicies

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>

* add missing webhook config for operatorpolicies

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>

* add missing webhook config for operatorpolicies

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>

* add missing webhook config for operatorpolicies

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>

* add missing webhook config for operatorpolicies

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>

---------

Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
This commit is contained in:
Ilia Lazebnik
2024-02-06 11:23:48 +02:00
committed by GitHub
parent 1b983e5baa
commit b139daf6f7
4 changed files with 199 additions and 1 deletions

View File

@@ -37,4 +37,4 @@ maintainers:
name: rabbitmq-cluster-operator
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq-cluster-operator
version: 3.15.3
version: 3.15.4

View File

@@ -0,0 +1,159 @@
# Source: https://raw.githubusercontent.com/rabbitmq/messaging-topology-operator/v{version}/config/crd/bases/rabbitmq.com_operatorpolicies.yaml
# Version: 1.13.0
# VersionOf: rmq-messaging-topology-operator
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: operatorpolicies.rabbitmq.com
spec:
group: rabbitmq.com
names:
categories:
- all
- rabbitmq
kind: OperatorPolicy
listKind: OperatorPolicyList
plural: operatorpolicies
singular: operatorpolicy
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: OperatorPolicy is the Schema for the operator policies 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:
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
type: string
metadata:
type: object
spec:
description: |-
OperatorPolicySpec defines the desired state of OperatorPolicy
https://www.rabbitmq.com/parameters.html#operator-policies
properties:
applyTo:
default: queues
description: |-
What this operator policy applies to: 'queues', 'classic_queues', 'quorum_queues', 'streams'.
Default to 'queues'.
enum:
- queues
- classic_queues
- quorum_queues
- streams
type: string
definition:
description: OperatorPolicy definition. Required property.
type: object
x-kubernetes-preserve-unknown-fields: true
name:
description: Required property; cannot be updated
type: string
pattern:
description: |-
Regular expression pattern used to match queues, e.g. "^my-queue$".
Required property.
type: string
priority:
default: 0
description: |-
Default to '0'.
In the event that more than one operator policy can match a given queue, the operator policy with the greatest priority applies.
type: integer
rabbitmqClusterReference:
description: |-
Reference to the RabbitmqCluster that the operator policy will be created in.
Required property.
properties:
connectionSecret:
description: |-
Secret contains the http management uri for the RabbitMQ cluster.
The Secret must contain the key `uri`, `username` and `password` or operator will error.
Have to set either name or connectionSecret, but not both.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
name:
description: |-
The name of the RabbitMQ cluster to reference.
Have to set either name or connectionSecret, but not both.
type: string
namespace:
description: |-
The namespace of the RabbitMQ cluster to reference.
Defaults to the namespace of the requested resource if omitted.
type: string
type: object
vhost:
default: /
description: Default to vhost '/'; cannot be updated
type: string
required:
- definition
- name
- pattern
- rabbitmqClusterReference
type: object
status:
description: OperatorPolicyStatus defines the observed state of OperatorPolicy
properties:
conditions:
items:
properties:
lastTransitionTime:
description: The last time this Condition status changed.
format: date-time
type: string
message:
description: Full text reason for current status of the condition.
type: string
reason:
description: One word, camel-case reason for current status
of the condition.
type: string
status:
description: True, False, or Unknown
type: string
type:
description: Type indicates the scope of the custom resource
status addressed by the condition.
type: string
required:
- status
- type
type: object
type: array
observedGeneration:
description: |-
observedGeneration is the most recent successful generation observed for this OperatorPolicy. It corresponds to the
OperatorPolicy's generation, which is updated on mutation by the API Server.
format: int64
type: integer
type: object
type: object
served: true
storage: true
subresources:
status: {}

View File

@@ -312,5 +312,23 @@ rules:
- get
- patch
- update
- apiGroups:
- rabbitmq.com
resources:
- operatorpolicies
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- rabbitmq.com
resources:
- operatorpolicies/status
verbs:
- get
{{- end }}
{{- end }}

View File

@@ -116,6 +116,27 @@ webhooks:
resources:
- federations
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "rmqco.msgTopologyOperator.webhook.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
path: /validate-rabbitmq-com-v1beta1-operatorpolicy
port: {{ .Values.msgTopologyOperator.service.ports.webhook }}
failurePolicy: Fail
name: voperatorpolicy.kb.io
rules:
- apiGroups:
- rabbitmq.com
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- operatorpolicies
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig: