-
Notifications
You must be signed in to change notification settings - Fork 287
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
Support Cloudstack multiple endpoint for preflight checks #2559
Merged
eks-distro-bot
merged 25 commits into
aws:main
from
wongni:support-multiple-acs-for-cmk-2
Jul 6, 2022
Merged
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
bda21a0
Support Cloudstack multiple endpoint for preflight checks
wongni c464ce9
Update for review comments
wongni e8e931f
Merge branch 'main' into support-multiple-acs-for-cmk-2
wongni 3efce41
Fix unit test failures
wongni 31679e2
Remove debug print
wongni 461a804
Remove unnecessary file
wongni dbdac2b
Remove multierror module
wongni 0a87c51
Update to use single cmk object instead of list or map of multiple cmks
wongni cbd45c9
Remove ValidateCloudStackConnection when cleaning up VMs
wongni 369b53d
Remove NewProviderCustomNet because it's the same as NewProvider
wongni 260ec6e
Avoid using 'failed to' in errors
wongni 5382943
Remove localAvailabilityZones from Validator
wongni dca6a9e
Remove multipleZone from ValidateNetworkPresent
wongni 074a62c
Return list of errors CleanUpCloudstackTestResources
wongni bdf278e
Increase unit test coverage
wongni 40c9ddb
Increase unit test coverage #2
wongni bdbd178
Change error format
wongni 9813e46
Change function names to be more descriptive
wongni 2ddc742
Add default verifySslValue as a constant
wongni 187c194
Fix a bug where empty Zone IDs are used in validateMachineConfig
wongni 0fe30a1
Merge branch 'aws:main' into support-multiple-acs-for-cmk-2
wongni 2ed1d16
Add error message when validating management api endpoint fails
wongni f6259dd
Make MarkPass message more readable
wongni 3683c61
Merge branch 'aws:main' into support-multiple-acs-for-cmk-2
wongni 222889c
Fix presubmit job failure
wongni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,6 +267,7 @@ func (f *Factory) WithProvider(clusterConfigFile string, clusterConfig *v1alpha1 | |
return fmt.Errorf("unable to get machine config from file %s: %v", clusterConfigFile, err) | ||
} | ||
|
||
// map[string]*executables.Cmk and map[string]ProviderCmkClient are not compatible so we convert the map manually | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this comment is no longer relevant right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right |
||
f.dependencies.Provider = cloudstack.NewProvider( | ||
datacenterConfig, | ||
machineConfigs, | ||
|
@@ -418,12 +419,13 @@ func (f *Factory) WithCmk() *Factory { | |
if f.dependencies.Cmk != nil { | ||
return nil | ||
} | ||
|
||
execConfig, err := decoder.ParseCloudStackSecret() | ||
if err != nil { | ||
return fmt.Errorf("building cmk executable: %v", err) | ||
} | ||
|
||
f.dependencies.Cmk = f.executableBuilder.BuildCmkExecutable(f.dependencies.Writer, *execConfig) | ||
f.dependencies.Cmk = f.executableBuilder.BuildCmkExecutable(f.dependencies.Writer, execConfig.Profiles) | ||
f.dependencies.closers = append(f.dependencies.closers, f.dependencies.Cmk) | ||
|
||
return nil | ||
|
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
11 changes: 11 additions & 0 deletions
11
pkg/dependencies/testdata/cloudstack_config_multiple_profiles.ini
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Global] | ||
verify-ssl = false | ||
api-key = test-key1 | ||
secret-key = test-secret1 | ||
api-url = http://127.16.0.1:8080/client/api | ||
|
||
[Instance2] | ||
verify-ssl = true | ||
api-key = test-key2 | ||
secret-key = test-secret2 | ||
api-url = http://127.16.0.2:8080/client/api |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we always call cmk.Close() regardless of whether the command itself failed?
Also, I do still feel like we should inform the user if there was an error. Maybe we can concatenate the names of all the profiles we failed to clean up as a string and if the string is not empty, return it as an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer cmk.Close(ctx)
at line 103 will take care of closing of cmk.I updated the error handling.