-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve region validation, only print log message in create cluster command #300
Conversation
EKSRegionUSWest2, | ||
EKSRegionUSEast1, | ||
EKSRegionEUWest1, | ||
func SupportedRegions() []string { |
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.
As you cannot declare const []string
, we prefer a function here. The previous version was written before we've adopted this convention. Just FYI :)
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.
Noted! 🔥
5a0db70
to
f1a69a9
Compare
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.
Looks good from this side of fence. 🎉 🥇
Stricly for my understanding, what's the policy on tests? Noticed we don't have any for either of these files. Altough I recognise something like IsSupportedRegion
is quite trivial, my brain was expecting a test for it.
@@ -248,7 +248,6 @@ func newSession(clusterConfig *api.ClusterConfig, endpoint string, credentials * | |||
} | |||
} | |||
|
|||
logger.Info("using region %s", clusterConfig.Region) |
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.
👍 - I noticed this as part of my previous change but decided to leave it out as I wasn't really sure if it was relevant for other calls. Seems like it is when we are actually creating the cluster.
EKSRegionUSWest2, | ||
EKSRegionUSEast1, | ||
EKSRegionEUWest1, | ||
func SupportedRegions() []string { |
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.
Noted! 🔥
Good question 👍. It'd be nice to have a clear policy stated somewhere. At the moment we avoid trivial tests, and favour testing critical code path and integration tests are getting into a shape, but need more love. Integration tests live in Packages like Most of critical path test are in What I think would be very nice is a kind of introspective integration test, where cluster would be created in stages and in the process of that several checks would be done. Perhaps we can do this in the current integration suite in a way, but that may need new code that fetches state from CloudFormation etc, as we exec eksctl and thereby don't have access to internal structures unless we over-engineer some kind of channel to it... However, some kind of dry-run mode that spews out CloudFormation definitions maybe a thing to think about, that could be useful for this and in few other cases, but that may need review of certain assumptions, which maybe a good thing anyway. What I'm thinking of is the coupling of cluster and nodegroup stacks, I don't think we can create nodegroup stack template without having a live cluster (or a mock of it), which is fine for most uses, but obviously isn't ideal for proper dry-run mode. Anyway, a bit of a brain dump, but hopefully still useful. So to sum up, I'd rather we work on end-to-end testing with introspection, then test trivial units in a race for some coverage figure. Hope it makes sense :) |
Description
Improve region validation, only print log message in create cluster command
Checklist
make build
)make test
)