feat(CSI-286): whitespace not trimmed for localContainerName in CSI secret #364
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR
Improved handling of
localContainerName
in thefromSecrets
function.What changed?
fromSecrets
function inpkg/wekafs/wekafs.go
.localContainerName
.localContainerName
in secrets.How to test?
localContainerName
containing leading/trailing whitespace or newline characters, e.g. when the string is encoded into Base64 together with a trailing newlinefromSecrets
function with these secrets.localContainerName
is properly trimmed.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 thatlocalContainerName
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.