# Adds namespace to all resources.
namespace: ${NAMESPACE}

# Prefix for names of all resources created by this kustomization
namePrefix: devworkspace-controller-

# Labels to add to all resources and selectors.
commonLabels:
  app.kubernetes.io/name: devworkspace-controller
  app.kubernetes.io/part-of: devworkspace-operator

bases:
- ../base
- ../components/cert-manager

patchesStrategicMerge:
- manager_certmanager_patch.yaml
- crd_webhooks_patch.yaml

configurations:
- kustomizeconfig.yaml

vars:
- name: WEBHOOK_CA_SECRET_NAME
  objref:
    kind: Certificate
    group: cert-manager.io
    version: v1
    name: serving-cert
  fieldref:
    fieldpath: spec.secretName
- name: CERTIFICATE_NAMESPACE
  objref:
    kind: Certificate
    group: cert-manager.io
    version: v1
    name: serving-cert
  fieldref:
    fieldpath: metadata.namespace
- name: CERTIFICATE_NAME
  objref:
    kind: Certificate
    group: cert-manager.io
    version: v1
    name: serving-cert
