-
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
Refactor the main API struct #283
Conversation
I'm running integration tests now. Would be great to see some reviews, as it's a big change, and we can use the opportunity to rename/restructure things etc. |
pkg/ctl/create/cluster.go
Outdated
@@ -32,7 +32,8 @@ var ( | |||
) | |||
|
|||
func createClusterCmd() *cobra.Command { | |||
cfg := &api.ClusterConfig{} | |||
cfg := api.NewClusterConfig() | |||
ng := &cfg.NodeGroups[0] |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Marked WIP as integration tests failed. |
aff744a
to
216a104
Compare
216a104
to
5579070
Compare
I think there is still a fair bit of refactoring needed to consistently represent multiple nodegroups, I'll try to have a go at it tomorrow, but it might be a thing for another PR. |
5579070
to
91d685d
Compare
Actually, it turned to be easy enough to remove single "initial" nodegroup assumption, but comments and log messages still need to be updated. |
92d32e4
to
d0a6007
Compare
48d8cec
to
7f6bb22
Compare
Need to re-run integration tests, and if all is well will remove WIP tag. |
This comment has been minimized.
This comment has been minimized.
7f6bb22
to
efad73a
Compare
Turns out |
efad73a
to
dfccefb
Compare
|
pkg/eks/api/api.go
Outdated
|
||
// HasSuffiecentPublicSubnets validates if there is a suffiecent | ||
// number of subnets available to create a cluster | ||
func (c ClusterVPC) HasSuffiecentPublicSubnets() bool { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This will accommodate for - multiple nodegroups - public and private subnets - use taskmanager tasks for nodegroup(s) deletion - cleanup nodegroup terminology
dfccefb
to
9c0d8a6
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.
LGTM Great work Ilya!
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.
This looks really good, a great change that will help a lot with future changes. The structual and naming changes are a real benefit. Great work @errordeveloper 🍾
type task func(chan error) error | ||
type task struct { | ||
call func(chan error, interface{}) error | ||
data interface{} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -32,13 +32,14 @@ var ( | |||
) | |||
|
|||
func createClusterCmd() *cobra.Command { | |||
cfg := &api.ClusterConfig{} | |||
cfg := api.NewClusterConfig() | |||
ng := cfg.NewNodeGroup() |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -89,13 +99,13 @@ func doDeleteCluster(cfg *api.ClusterConfig, name string) error { | |||
|
|||
if clusterErr { | |||
if handleIfError(ctl.DeprecatedDeleteControlPlane(), "control plane") { | |||
handleIfError(stackManager.DeprecatedDeleteStackControlPlane(waitDelete), "stack control plane") | |||
handleIfError(stackManager.DeprecatedDeleteStackControlPlane(waitDelete), "stack control plane (deprecated)") |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -28,7 +29,7 @@ func scaleNodeGroupCmd() *cobra.Command { | |||
|
|||
fs.StringVarP(&cfg.ClusterName, "name", "n", "", "EKS cluster name") | |||
|
|||
fs.IntVarP(&cfg.Nodes, "nodes", "N", -1, "total number of nodes (scale to this number)") | |||
fs.IntVarP(&ng.DesiredCapacity, "nodes", "N", -1, "total number of nodes (scale to this number)") |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@stefanprodan @richardcase thanks for the reviews! |
Make storageclass paramter case in-sensitive
Description
These changes will allow for:
This is a big change, but it shouldn't affect user-visible functionality at all.
Checklist
make build
)make test
)