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(rds): Infer cache secret namespace from pod environment #1893

Merged

Conversation

MisterMX
Copy link
Collaborator

@MisterMX MisterMX commented Oct 10, 2023

Description of your changes

This adds a function that infers the namespace of the RDS password cache secret from the following locations (in order):

  1. POD_NAMESPACE env var
  2. /var/run/secrets/kubernetes.io/serviceaccount/namespace file
  3. fallback to crossplane-system

Until now crossplane-system was the hardcoded value.

Fixes #1834

Please note that this might cause a regeneration of passwords if the provider is running in another namespace than crossplane-system, but, due to the change, is now looking for the secret in another namespace where it does not exist.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

n.a.

Signed-off-by: Maximilian Blatt (external expert on behalf of DB Netz) <maximilian.blatt-extern@deutschebahn.com>
@MisterMX MisterMX merged commit 3a860f1 into crossplane-contrib:master Oct 13, 2023
11 checks passed
@MisterMX MisterMX deleted the fix/rds-cache-default-namespace branch October 19, 2023 08:49
@flaviomoringa
Copy link

@MisterMX I was waiting for this fix, but apparently its still not in the latest version, right?

@MisterMX
Copy link
Collaborator Author

MisterMX commented Nov 7, 2023

I was waiting for this fix, but apparently its still not in the latest version, right?

We haven't backported this since it is a breaking change. It is going to be in the next minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DBInstance] Needs namespace "crossplane-system" to store values in cache (version 0.42)
3 participants