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: refactor KsDecode to handle stringData and data nodes #543

Merged

Conversation

yxxhero
Copy link
Member

@yxxhero yxxhero commented Oct 13, 2024

This pull request includes several changes to improve code readability, enhance error handling, and update functionality in the cmd/vals, pkg/log, and pkg/providers/vault packages. The most important changes include updating variable names for clarity, adding error handling for fmt.Fprintln and fmt.Fprintf, and modifying the KsDecode function to handle both data and stringData nodes.

Improvements to readability and error handling:

  • cmd/vals/main.go: Updated variable names in the KsDecode function to make the code more understandable and added comments to explain the logic. [1] [2] [3]
  • cmd/vals/main.go: Added error handling for fmt.Fprintln to ignore returned values.
  • io.go: Added error handling for fmt.Fprintln to ignore returned values. [1] [2]
  • pkg/log/log.go: Added error handling for fmt.Fprintf to ignore returned values.

Functional updates:

  • cmd/vals/main.go: Modified the KsDecode function to handle both data and stringData nodes, ensuring proper decoding and merging of these nodes. [1] [2]
  • cmd/vals/main_test.go: Updated test cases to include stringData nodes, ensuring the new functionality is tested.

Other changes:

Signed-off-by: yxxhero <aiopsclub@163.com>
@yxxhero
Copy link
Member Author

yxxhero commented Oct 13, 2024

#520

Signed-off-by: yxxhero <aiopsclub@163.com>
@yxxhero
Copy link
Member Author

yxxhero commented Oct 13, 2024

@mumoshu

Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for your continued effort @yxxhero!

@yxxhero yxxhero merged commit a9480c5 into main Oct 14, 2024
4 checks passed
@yxxhero yxxhero deleted the feat--refactor-KsDecode-to-handle-stringData-and-data-nodes branch October 14, 2024 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decoding of Kubernetes Secrets fails when Secret has both data and stringData
2 participants