VictoriaMetrics / operator

Kubernetes operator for Victoria Metrics
Apache License 2.0
422 stars 140 forks source link

BUG: VMUser: passwordRef ignored, when disable_secret_creation is true #863

Closed tamcore closed 6 months ago

tamcore commented 7 months ago

As the title suggests, when VMUser.spec.disable_secret_creation is set to true (because the Secret is managed externally, for example by External Secrets), the Secret referenced in passwordRef is no longer fetched, resulting the VMAuth configuration containing the configuration for the user without a password.

I believe this is because of this block of code:

https://github.com/VictoriaMetrics/operator/blob/bfc521d3b22d696c2244318a2d93a5fee7a93452/controllers/factory/vmuser.go#L246-L248

in the fetchVMUserSecretCacheByRef function.

From my understanding, setting disable_secret_creation should only prevent the operator from creating the Secret, but not prevent it from reading what user has defined in said Secret.

f41gh7 commented 7 months ago

Hello, it's a regression. Thanks for reporting, we're going to fix it soon.

f41gh7 commented 6 months ago

It must be fixed as part of v0.41.2 release. Feel free to re-open issue.

tamcore commented 6 months ago

Yep. Issue seems fixed for us. Thanks a lot!