-
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 16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,12 +99,20 @@ func CleanUpCloudstackTestResources(ctx context.Context, clusterName string, dry | |
if err != nil { | ||
return fmt.Errorf("building cmk executable: %v", err) | ||
} | ||
cmk := executableBuilder.BuildCmkExecutable(tmpWriter, *execConfig) | ||
cmk := executableBuilder.BuildCmkExecutable(tmpWriter, execConfig.Profiles) | ||
defer cmk.Close(ctx) | ||
|
||
if err := cmk.ValidateCloudStackConnection(ctx); err != nil { | ||
return fmt.Errorf("validating cloudstack connection with cloudmonkey: %v", err) | ||
failedProfiles := []string{} | ||
errors := []error{} | ||
for _, profile := range execConfig.Profiles { | ||
if err := cmk.CleanupVms(ctx, profile.Name, clusterName, dryRun); err != nil { | ||
failedProfiles = append(failedProfiles, profile.Name) | ||
errors = append(errors, err) | ||
} | ||
} | ||
|
||
return cmk.CleanupVms(ctx, clusterName, dryRun) | ||
if len(failedProfiles) > 0 { | ||
return fmt.Errorf("cleaning up VMs: profiles=%+v, errors=%+v", failedProfiles, errors) | ||
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. Should we be doing a profile=error mapping instead if that is the intention here? 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. Updated. The new code will return an error with this kind of message.
|
||
} | ||
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
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.
Sorry to keep going back and forth on this, it might be good to include the err message itself as well for debugging purposes