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

Enable decryption of secrets generated by Kustomize components #1283

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed decryption in components.
Signed-off-by: Yuriy <yuriy@vlasov.pro>
  • Loading branch information
vlasov-y committed Nov 8, 2024
commit 443c96a788baeb6fd76c57b30b568c6f3acad46e
6 changes: 5 additions & 1 deletion internal/decryptor/decryptor.go
Original file line number Diff line number Diff line change
@@ -697,9 +697,13 @@ func recurseKustomizationFiles(root, path string, visit visitKustomization, visi
return err
}

// Components may contain resources as well, ...
// ...so we have to process both .resources and .components values
resources := append(kus.Resources, kus.Components...)
Copy link
Member

Choose a reason for hiding this comment

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

Please write a test for decrypting an env file found in a component, this should be added to https://github.com/fluxcd/kustomize-controller/blob/main/internal/controller/kustomization_decryptor_test.go

Copy link
Contributor Author

@vlasov-y vlasov-y Nov 10, 2024

Choose a reason for hiding this comment

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

Hi @stefanprodan
Thanks, I have updated the code and added the test.


// Recurse over other resources in Kustomization,
// repeating the above logic per item
for _, res := range kus.Resources {
for _, res := range resources {
if !filepath.IsAbs(res) {
res = filepath.Join(path, res)
}