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

fix: use names from resources directly #2135

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

Andor
Copy link
Contributor

@Andor Andor commented Jun 7, 2023

Description

Currently, if you override for any reason Prometheus' ServiceAccount name, the related subject name will not change.

The workaround is to override subject alongside with overriding ServiceAccount name, which is not ideal.

          serviceAccount+: {
            metadata+: {
              name: 'my-serviceaccount-name',
            },
          },
...
          clusterRoleBinding+: {
            subjects: [{
              kind: 'ServiceAccount',
              name: 'my-serviceaccount-name',
              namespace: 'my-namespace',
            }],

The same for Role and ClusterRole name in RoleBinding and ClusterRoleBinding accordingly.

This patch fixes this behaviour and you will be able to override

Type of change

What type of changes does your code introduce to the kube-prometheus? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Please put a one-line changelog entry below. Later this will be copied to the changelog file.

Use ServiceAccount, Role and ClusterRole names in RoleBinding and ClusterRoleBinding referencing from the according resources instead of generating on the spot.

@Andor
Copy link
Contributor Author

Andor commented Jun 9, 2023

Apparently tests are failing for non-related reason.

@philipgough
Copy link
Contributor

Apparently tests are failing for non-related reason.

Correct, CI was broken but is back green now. Triggered this again.

@Andor
Copy link
Contributor Author

Andor commented Jun 15, 2023

@philipgough much appreciate mate.
Now it is all green.

@philipgough philipgough merged commit 4068700 into prometheus-operator:main Jul 17, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants