# The kustomize base for the audio operator.
#
# This base is for the cluster owner to take. liken does not apply it
# and does not name it. Take it through your own GitOps with patches
# of your own, or read it and write your own manifests.
#
# The base ships one DeviceClass, sound-card, because the claim
# template in operator.yaml names it and the operator cannot start
# without it: it is wiring, not policy. The class workloads claim
# through is the cluster owner's to create, because it is cluster
# policy, and the install guide gives the YAML for audio-output,
# the one to start with. An owner who renames sound-card patches
# both the class and the template.
#
# The namespace below is set with a transformer rather than with the
# top-level namespace field, because unsetOnly is what keeps the one
# object that names its own namespace where it belongs: the RoleBinding
# in kube-system that lets audio-api read the cluster's client
# certificate authority. The top-level field overwrites a stated
# namespace, and that binding in any other namespace names a Role that
# is not there. Every other object here states no namespace, and the
# transformer sets liken-system on each of them.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

transformers:
  - |-
    apiVersion: builtin
    kind: NamespaceTransformer
    metadata:
      name: liken-system
      namespace: liken-system
    unsetOnly: true

# The transformer above stamps the namespace onto the DeviceClass too,
# because resource.k8s.io/v1 is not in its compiled OpenAPI schema
# and an unknown kind is treated as namespaced. The stamp is
# harmless: the API server ignores a namespace on a cluster-scoped
# object, and kubectl routes the request by the scope it reads from
# discovery, not from the object.
resources:
  - crds.yaml
  - deviceclasses.yaml
  - rbac.yaml
  - operator.yaml
  - api.yaml
  - api-authentication.yaml

labels:
  - includeSelectors: false
    pairs:
      app.kubernetes.io/name: audio-operator
      app.kubernetes.io/part-of: liken

images:
  - name: ghcr.io/liken-sh/audio-operator
    newTag: latest
