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 null and empty object comparison #275

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Conversation

jenting
Copy link
Contributor

@jenting jenting commented Jul 25, 2024

Fixes #273

We found that if the VaultSecret without label, the corresponding k8s secret keeps updating because the two secrets labels are not the same. It's because existing k8s secret labels is null, however, the k8s secret labels generated from newSecretForCR is an empty object.

The generated k8s secret labels and annotations are directly inherited from the VaultSecret CR, so it does not require to loop it and copy it again.

Also, we fix the go-staticcheck warnings that

  1. should use time.Until instead of t.Sub(time.Now())
  2. error strings should not be capitalized

@jenting
Copy link
Contributor Author

jenting commented Jul 25, 2024

@ricoberger PTAL when you're available, thank you 😊

@ricoberger
Copy link
Owner

Thanks for your fix @jenting 🙂

@ricoberger ricoberger merged commit f2d8657 into ricoberger:main Jul 26, 2024
7 checks passed
@ricoberger ricoberger added the changelog: fixed Something which wasn't working is fixed label Jul 26, 2024
@jenting jenting deleted the fix-null branch July 26, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fixed Something which wasn't working is fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check secret resource is changed before updating it
2 participants