Skip to content

redpanda: correct Role and ClusterRole naming #927

Merged
RafalKorepta merged 2 commits intomainfrom
chris/p/k8s-661-rbac-naming
Jun 20, 2025
Merged

redpanda: correct Role and ClusterRole naming #927
RafalKorepta merged 2 commits intomainfrom
chris/p/k8s-661-rbac-naming

Conversation

@chrisseto
Copy link
Contributor

In 5d72f8a, the Names for Roles generated by
the chart were mistakenly changed from Fullname to Name. This regression
went by unnoticed as we did not have any tests that installed multiple
instances of the chart into a single namespace.

This commit corrects the regression and updates the naming of ClusterRoles to
include the release namespace. This allows:

  • Installing multiple instances of the chart into a single namespace.
  • Installing multiple instances of the chart with the same release name into different namespaces.

}

select {
case <-time.After(10 * time.Second):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm opting to not make this configurable for now as I don't see a particularly pressing reason to do so.

// continuously refreshed via [Ctl.Get] before calling cond. If ctx does not
// have a deadline a default of 5m will be used.
func (c *Ctl) WaitFor(ctx context.Context, obj Object, cond CondFn[Object]) error {
const timeout = 5 * time.Minute
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is configurable by passing in a context with a deadline attached.

This commit improves the ergonomics of the kube.Ctl struct by allowing
configuration with variadic options and implementing Apply. These improvements
have been carried over to the kubetest.NewEnv function as well. Most notably,
this allows specifying the Scheme of the testenv which makes it useable when
testing CRDs.
In 5d72f8a, the Names for `Role`s generated by
the chart were mistakenly changed from `Fullname` to `Name`. This regression
went by unnoticed as we did not have any tests that installed multiple
instances of the chart into a single namespace.

This commit corrects the regression and updates the naming of `ClusterRole`s to
include the release namespace. This allows:
- Installing multiple instances of the chart into a single namespace.
- Installing multiple instances of the chart with the same release name into different namespaces.
@chrisseto chrisseto force-pushed the chris/p/k8s-661-rbac-naming branch from edf1dba to e9a6919 Compare June 19, 2025 21:00
@RafalKorepta RafalKorepta merged commit d7ad813 into main Jun 20, 2025
10 checks passed
@RafalKorepta RafalKorepta deleted the chris/p/k8s-661-rbac-naming branch June 20, 2025 09:54
@RafalKorepta
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
release/v25.1.x
release/v2.4.x Conflict resolution was aborted by the user
release/v2.3.x Conflict resolution was aborted by the user

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

backport --pr 927

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@RafalKorepta
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
release/v25.1.x
release/v2.4.x Conflict resolution was aborted by the user
release/v2.3.x Conflict resolution was aborted by the user

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

backport --pr 927

Questions ?

Please refer to the Backport tool documentation

@david-yu
Copy link
Contributor

@chris @RafalKorepta This should be backported for 2.4.x and 2.3.x as well

@chrisseto
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
release/v2.4.x
release/v2.3.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@chrisseto
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
release/v2.4.x
release/v2.3.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

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.

3 participants