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

Replace full folder mount to per file mount of extra CA certificates #613

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

slashben
Copy link
Contributor

@slashben slashben commented Feb 6, 2025

This pull request includes changes to the kubescape-operator Helm chart templates to improve the handling of extra CA certificates. The main modification involves iterating over the keys in the specified secret and mounting each key as a separate file instead of overriding the whole directory

Changes to improve handling of extra CA certificates:

Signed-off-by: Ben <ben@armosec.io>
@matthyx matthyx self-assigned this Feb 6, 2025
Copy link
Contributor

@matthyx matthyx left a comment

Choose a reason for hiding this comment

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

can you add a few such secrets in one of the unit tests?

name: extra-certificates
namespace: kubescape
data:
cert1: Zm9v
Copy link
Contributor

Choose a reason for hiding this comment

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

@slashben it doesn't seem to work...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See this

{{- range $key, $value := (lookup "v1" "Secret" .Release.Namespace .Values.global.extraCaCertificates.secretName).data }}

it looks like lookup is not easily testable. I don't see a way to mock it, on the other hand I don't know how to accommodate the requirement.

This might not be covered by the unittest, but it works on a real cluster

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@matthyx matthyx force-pushed the fix/appending-extra-cas branch from 5013f68 to f00e155 Compare February 17, 2025 09:51
@matthyx matthyx merged commit 1ba56c3 into main Feb 17, 2025
7 checks passed
@matthyx matthyx deleted the fix/appending-extra-cas branch February 17, 2025 09:55
Copy link
Contributor Author

@slashben slashben left a comment

Choose a reason for hiding this comment

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

looks good

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

Successfully merging this pull request may close these issues.

2 participants