snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Using the -Dquarkus.kubernetes.namespace option does not update subjects #324

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

When the src/main/kubernetes.yml contains a ClusterRoleBinding referencing a ServiceAccount in the same file and you try to override the namespace via the quarkus.kubernetes.namespace property, the referenced ServiceAccount namespace will not be updated.

To Reproduce

Use a src/main/kubernetes.yml like:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: sa-name
  labels:
    app: sa-name
...
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cr-name
subjects:
  - kind: ServiceAccount
    name: sa-name
    namespace: default-namespace
...

A maven package with -Dquarkus.kubernetes.namespace=expected

Will generate a kubernetes.yml with:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
...
subjects:
- kind: ServiceAccount
  name: sa-name
  namespace: default-namespace

Rather than updating the subject to the expected namespace - all of the top level resources though will specify the expected namespace.

Configuration

Quarkus version or git rev

1.11.1.Final


https://github.com/quarkusio/quarkus/issues/16763


$upstream:16763$