# Wanaku Operator Configuration

# HTTP Configuration
quarkus.http.port=8081
quarkus.devservices.enabled=false

# Logging Configuration
quarkus.log.console.enable=true
quarkus.log.console.level=INFO
quarkus.log.category."ai.wanaku".level=DEBUG

quarkus.operator-sdk.crd.apply=true

# Kubernetes Configuration
quarkus.kubernetes.image-pull-policy=if-not-present

# Helm Configuration
# Generate namespace field in ClusterRoleBinding subjects (required for Helm)
quarkus.kubernetes.rbac.service-accounts.wanaku-operator.namespace=placeholder
# Replace the placeholder namespace with the Helm release namespace expression
quarkus.helm.expressions.0.path=(kind == ClusterRoleBinding).subjects.namespace
quarkus.helm.expressions.0.expression={{ .Release.Namespace }}
quarkus.helm.expressions.9.path=(kind == RoleBinding).subjects.namespace
quarkus.helm.expressions.9.expression={{ .Release.Namespace }}
# Replace placeholder namespace on ServiceAccount
quarkus.helm.expressions.10.path=(kind == ServiceAccount).metadata.namespace
quarkus.helm.expressions.10.expression={{ .Release.Namespace }}

# Prefix ClusterRole names with release namespace to avoid conflicts across namespaces
quarkus.helm.expressions.1.path=(kind == ClusterRole && metadata.name == wanaku-capability-cluster-role).metadata.name
quarkus.helm.expressions.1.expression={{ .Release.Namespace }}-wanaku-capability-cluster-role
quarkus.helm.expressions.2.path=(kind == ClusterRole && metadata.name == wanaku-router-cluster-role).metadata.name
quarkus.helm.expressions.2.expression={{ .Release.Namespace }}-wanaku-router-cluster-role
quarkus.helm.expressions.3.path=(kind == ClusterRole && metadata.name == josdk-crd-validating-cluster-role).metadata.name
quarkus.helm.expressions.3.expression={{ .Release.Namespace }}-josdk-crd-validating-cluster-role
quarkus.helm.expressions.11.path=(kind == ClusterRole && metadata.name == wanaku-service-catalog-cluster-role).metadata.name
quarkus.helm.expressions.11.expression={{ .Release.Namespace }}-wanaku-service-catalog-cluster-role

# Prefix ClusterRoleBinding names with release namespace
quarkus.helm.expressions.4.path=(kind == ClusterRoleBinding && metadata.name == wanaku-capability-crd-validating-role-binding).metadata.name
quarkus.helm.expressions.4.expression={{ .Release.Namespace }}-wanaku-capability-crd-validating-role-binding
quarkus.helm.expressions.5.path=(kind == ClusterRoleBinding && metadata.name == wanaku-router-crd-validating-role-binding).metadata.name
quarkus.helm.expressions.5.expression={{ .Release.Namespace }}-wanaku-router-crd-validating-role-binding
quarkus.helm.expressions.12.path=(kind == ClusterRoleBinding && metadata.name == wanaku-service-catalog-crd-validating-role-binding).metadata.name
quarkus.helm.expressions.12.expression={{ .Release.Namespace }}-wanaku-service-catalog-crd-validating-role-binding

# Update ClusterRoleBinding roleRef to match prefixed ClusterRole names
quarkus.helm.expressions.6.path=(kind == ClusterRoleBinding).roleRef.name
quarkus.helm.expressions.6.expression={{ .Release.Namespace }}-josdk-crd-validating-cluster-role

# Map imagePullPolicy to a configurable Helm value
quarkus.helm.values."app.imagePullPolicy".paths=(kind == Deployment).spec.template.spec.containers.imagePullPolicy
