-
Notifications
You must be signed in to change notification settings - Fork 336
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
fix(cni): test #12590
Draft
bartsmykla
wants to merge
21
commits into
master
Choose a base branch
from
fix/handle-cni-service-account-token-renewal
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
fix(cni): test #12590
+444
−387
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replaced hardcoded paths in CNI install functions with parameters for better flexibility. Updated `prepareKubeconfig` and `prepareKumaCniConfig` to accept token and CA certificate paths as arguments. Adjusted constant definitions for service account paths in `main.go` and refactored related logic accordingly Signed-off-by: Bart Smykla <bartek@smykla.com>
Simplified error handling in CNI installation functions by using inline checks for atomic writes and permission changes. Replaced redundant error assignments with direct conditionals. Improved clarity and reduced boilerplate in `Run`, `install`, and related functions. Signed-off-by: Bart Smykla <bartek@smykla.com>
Renamed the receiver in `InstallerConfig.Validate` from `i` to `c` for better consistency. Signed-off-by: Bart Smykla <bartek@smykla.com>
Enhanced error messages in `checkInstall` to include more context and specificity. Updated file existence checks to provide file paths in errors. Improved clarity in chained and standalone plugin validation errors by adding details about expected formats and missing configurations. Signed-off-by: Bart Smykla <bartek@smykla.com>
Improved error messages in validation functions for better clarity and context. Updated `isValidConfFile` and `isValidConflistFile` to provide specific details about missing fields. Enhanced logging to better describe validation results and failures for configuration and conflist files. Signed-off-by: Bart Smykla <bartek@smykla.com>
Refined error handling in `main.go` to enhance clarity and reduce redundancy. Replaced multierr with `errors.Join` for better error aggregation. Improved logging messages for binary copying and config reversion to include more context. Adjusted function parameters for better consistency. Signed-off-by: Bart Smykla <bartek@smykla.com>
Introduced context propagation in installation and setup functions for better control over operations. Enhanced error messages across various functions to provide more clarity and context. Updated file and path handling to use `filepath` for consistency and robustness. Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Refactored CNI config file discovery logic into a `PostProcess` method within `InstallerConfig`. This simplifies the `loadInstallerConfig` function and ensures config file detection is handled consistently. Added logging to improve visibility into file discovery and fallback behavior. Signed-off-by: Bart Smykla <bartek@smykla.com>
Updated tests for `InstallerConfig` to include `PostProcess` method validation. Changed paths in test cases to use `filepath` for better compatibility Signed-off-by: Bart Smykla <bartek@smykla.com>
Moved kubeconfig preparation logic into `InstallerConfig` methods for better encapsulation. Added `GenerateKubeconfigTemplate`. Signed-off-by: Bart Smykla <bartek@smykla.com>
Changed `PrepareKubeconfig` and `PrepareKumaCniConfig` to take token data directly instead of reading from a file. Made config preparation simpler with better logging. Updated tests and golden files to match changes Signed-off-by: Bart Smykla <bartek@smykla.com>
Moved `checkInstall` logic into `InstallerConfig.CheckInstall` for better encapsulation. Updated runtime and test code to use the new method. Removed the old `checkInstall` function and related validation tests Signed-off-by: Bart Smykla <bartek@smykla.com>
Updated `InstallerConfig` to include default paths for service account token and CA certificate. Simplified `PrepareKubeconfig` and `PrepareKumaCniConfig` methods to read required files internally. Adjusted main installation logic to check existing configurations before proceeding with installation. Updated tests to reflect the changes Signed-off-by: Bart Smykla <bartek@smykla.com>
bartsmykla
added
ci/run-full-matrix
PR: Runs all possible e2e test combination (expensive use carefully)
ci/verify-stability
labels
Jan 18, 2025
Reviewer Checklist🔍 Each of these sections need to be checked by the reviewer of the PR 🔍:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ci/run-full-matrix
PR: Runs all possible e2e test combination (expensive use carefully)
ci/verify-stability
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.
IN PROGRESS: just want to check stability
Motivation
Implementation information
Supporting documentation
Fix #XX