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

feat(CSI-286): whitespace not trimmed for localContainerName in CSI secret #364

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

sergeyberezansky
Copy link
Collaborator

@sergeyberezansky sergeyberezansky commented Oct 13, 2024

TL;DR

Improved handling of localContainerName in the fromSecrets function.

What changed?

  • Modified the fromSecrets function in pkg/wekafs/wekafs.go.
  • Added trimming of whitespace and newline characters from localContainerName.
  • Restructured the conditional logic for handling the presence of localContainerName in secrets.

How to test?

  1. Provide secrets with localContainerName containing leading/trailing whitespace or newline characters, e.g. when the string is encoded into Base64 together with a trailing newline
  2. Call the fromSecrets function with these secrets.
  3. Verify that the resulting localContainerName is properly trimmed.
  4. Test with and without localContainerName in the secrets to ensure correct behavior in both cases.

Why make this change?

This change improves the robustness of the fromSecrets function by ensuring that localContainerName is properly sanitized. It prevents potential issues caused by unintended whitespace or newline characters, which could lead to unexpected behavior in downstream operations that rely on this value.

@graphite-app graphite-app bot requested a review from tigrawap October 13, 2024 10:21
Copy link
Collaborator Author

sergeyberezansky commented Oct 13, 2024

Copy link

graphite-app bot commented Oct 13, 2024

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (10/13/24)

1 reviewer was added to this PR based on Sergey Berezansky's automation.

@sergeyberezansky sergeyberezansky changed the title feat(CSI-286): new line is not trimmed for localContainerName in CSI secret feat(CSI-286): whitespace not trimmed for localContainerName in CSI secret Oct 13, 2024
@sergeyberezansky sergeyberezansky force-pushed the sergey/sanitize-local-container-name branch from a55747e to 997b957 Compare October 13, 2024 11:55
@sergeyberezansky sergeyberezansky changed the base branch from dev to sergey/handle-ro-user-issues October 13, 2024 11:55
@sergeyberezansky sergeyberezansky changed the base branch from sergey/handle-ro-user-issues to graphite-base/364 October 13, 2024 12:30
@sergeyberezansky sergeyberezansky force-pushed the sergey/sanitize-local-container-name branch from 997b957 to 575a1b3 Compare October 13, 2024 12:30
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/364 to dev October 13, 2024 12:30
@sergeyberezansky sergeyberezansky force-pushed the sergey/sanitize-local-container-name branch from 575a1b3 to 1f47973 Compare October 13, 2024 12:31
@sergeyberezansky sergeyberezansky merged commit 630f103 into dev Oct 13, 2024
13 checks passed
@sergeyberezansky sergeyberezansky deleted the sergey/sanitize-local-container-name branch October 15, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant