Avoid nodeGroups[0].name must be set validation error#1186
Merged
errordeveloper merged 7 commits intomasterfrom Aug 22, 2019
Merged
Avoid nodeGroups[0].name must be set validation error#1186errordeveloper merged 7 commits intomasterfrom
nodeGroups[0].name must be set validation error#1186errordeveloper merged 7 commits intomasterfrom
Conversation
Contributor
Author
|
I'm, going to have a go at adding some unit test to cover this, possibly also integration tests. |
Some commands that don't have `--config-file` have custom defaulting and validation logic. This brings the time that logic is called before general validation and defaulting is called (i.e. `cmd.NewCtl`). Namely, it ensures that `eksctl get ng`, `eksctl scale ng` and `eksctl utils write-kubeconfig` work correctly.
48b3053 to
9fac552
Compare
marccarre
previously approved these changes
Aug 22, 2019
cPu1
reviewed
Aug 22, 2019
f708b89 to
facb30b
Compare
…flag is not used
facb30b to
a188cd1
Compare
Contributor
Author
|
@cPu1 what do you make of the most recent commit? |
cPu1
previously approved these changes
Aug 22, 2019
Contributor
LGTM. The unit test is failing because the change to |
Contributor
Author
|
Yes, I'll fix the unit tests and try to add some new ones also.... |
Contributor
Author
|
I'd like to add |
- validate remote points at upstream - push to release branch instead of master
037ec74 to
67c6ea9
Compare
cPu1
approved these changes
Aug 22, 2019
| }) | ||
|
|
||
| It("loader should handle nodegroup exclusion with config file", func() { | ||
| loaderParams := []struct { |
Contributor
There was a problem hiding this comment.
Alternative way:
loaderParams := []struct {
configFile string
nodeGroupCount int
}{
{"01-simple-cluster.yaml", 1, true},
{"02-custom-vpc-cidr-no-nodes.yaml", 0, true},
{"03-two-nodegroups.yaml", 2, true},
{"05-advanced-nodegroups.yaml", 3, true},
{"07-ssh-keys.yaml", 5, true},
}
for _, loaderTest := range loaderParams {
cmd := &Cmd{
CobraCommand: newCmd(),
ClusterConfigFile: filepath.Join(examplesDir, loaderTest.configFile),
ClusterConfig: api.NewClusterConfig(),
ProviderConfig: &api.ProviderConfig{},
}
ngFilter := NewNodeGroupFilter()
for _, withoutNodeGroup := range []bool{true, false} {
Expect(NewCreateClusterLoader(cmd, ngFilter, nil, withoutNodeGroup).Load()).To(Succeed())
Expect(ngFilter.ExcludeAll).To(Equal(withoutNodeGroup))
Expect(cmd.ClusterConfig.NodeGroups).To(HaveLen(loaderTest.nodeGroupCount))
_, err := cmd.NewCtl()
Expect(err).ToNot(HaveOccurred())
}
}
Contributor
Author
There was a problem hiding this comment.
yeah, I thought about it, but didn't seem to make that much difference
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This fixes #1164 and related cases of the same error. This is a regression that was introduced by #1116 and #1124.
Checklist
make build)make test)