Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support parameters api for rabbitmq #1508

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions addons/rabbitmq/templates/_names.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ Define rabbitmq component definition name
{{ include "rabbitmq.cmpdNamePrefix" . }}{{ .Chart.Version }}
{{- end -}}

{{/*
Define rabbitmq pcr definition name
*/}}
{{- define "rabbitmq.pcrName" -}}
{{ include "rabbitmq.cmpdNamePrefix" . }}pcr
{{- end -}}

{{/*
Define rabbitmq pcr definition name
*/}}
{{- define "rabbitmq.paramsDefName" -}}
{{ include "rabbitmq.cmpdNamePrefix" . }}pd
{{- end -}}

{{/*
Define config constriant name
*/}}
Expand Down
3 changes: 0 additions & 3 deletions addons/rabbitmq/templates/componentdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ spec:
configs:
- name: config
templateRef: {{ include "rabbitmq.configTplName" . }}
constraintRef: {{ include "rabbitmq.configConstraintName" . }}
volumeName: rabbitmq-config
namespace: {{ .Release.Namespace }}
defaultMode: 0644 # for only read
keys:
- rabbitmq.conf
systemAccounts:
- name: root
initAccount: true
Expand Down
41 changes: 0 additions & 41 deletions addons/rabbitmq/templates/configconstraint.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions addons/rabbitmq/templates/paramsdef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- $pd := .Files.Get "config/config-effect-scope.yaml" | fromYaml }}
apiVersion: parameters.kubeblocks.io/v1alpha1
kind: ParametersDefinition
metadata:
name: {{ include "rabbitmq.paramsDefName" . }}
labels:
{{- include "rabbitmq.labels" . | nindent 4 }}
spec:
fileName: rabbitmq.conf
parametersSchema:
# top level rabbitmq configuration type
topLevelKey: RabbitMQParameter

# schemaInJSON: auto generate from cue scripts
cue: |-
{{- .Files.Get "config/config-constraint.cue" | nindent 6 }}

## define static parameter list
{{- if hasKey $pd "staticParameters" }}
staticParameters:
{{- $params := get $pd "staticParameters" }}
{{- range $params }}
- {{ . }}
{{- end }}
{{- end}}
15 changes: 15 additions & 0 deletions addons/rabbitmq/templates/pcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: parameters.kubeblocks.io/v1alpha1
kind: ParamConfigRenderer
metadata:
name: {{ include "rabbitmq.pcrName" . }}
labels:
{{- include "rabbitmq.labels" . | nindent 4 }}
spec:
componentDef: {{ include "rabbitmq.cmpdName" . }}
parametersDefs:
- {{ include "rabbitmq.paramsDefName" . }}

configs:
- name: rabbitmq.conf
fileFormatConfig:
format: properties
Loading