Skip to content
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

Clear separation between api.ClusterConfig and api.ClusterProvider #309

Merged
merged 1 commit into from
Nov 8, 2018

Conversation

errordeveloper
Copy link
Contributor

Description

This refactors how we separate provider configuration and it's recievers
from cluster configuration. We no longer copy cluster configuration in
every places where we need it, instead we pass it explicitly every time.

Checklist

  • Code compiles correctly (i.e make build)
  • Added tests that cover your change (if possible)
  • All tests passing (i.e. make test)
  • Added/modified documentation as required (such as the README)
  • Added yourself to the humans.txt file

pkg/eks/eks.go Outdated Show resolved Hide resolved
pkg/utils/kubeconfig/kubeconfig.go Outdated Show resolved Hide resolved
pkg/eks/api/api.go Outdated Show resolved Hide resolved
pkg/ctl/get/cluster.go Outdated Show resolved Hide resolved
pkg/ctl/utils/wait_nodes.go Outdated Show resolved Hide resolved
@errordeveloper errordeveloper force-pushed the decouple-provider-and-cluster branch 2 times, most recently from 6383198 to cc8ef80 Compare November 7, 2018 17:34
pkg/eks/api/api.go Outdated Show resolved Hide resolved
pkg/utils/kubeconfig/kubeconfig.go Outdated Show resolved Hide resolved
@errordeveloper errordeveloper force-pushed the decouple-provider-and-cluster branch 2 times, most recently from d414e20 to c5aa0ae Compare November 7, 2018 17:40
pkg/eks/eks.go Outdated Show resolved Hide resolved
Copy link
Contributor Author

@errordeveloper errordeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few things to tidy up...

@errordeveloper errordeveloper force-pushed the decouple-provider-and-cluster branch 3 times, most recently from 12dfa42 to e322a96 Compare November 8, 2018 07:51
@errordeveloper errordeveloper changed the title WIP: Clear separation between api.ClusterConfig and api.ClusterProvider Clear separation between api.ClusterConfig and api.ClusterProvider Nov 8, 2018
@errordeveloper errordeveloper force-pushed the decouple-provider-and-cluster branch 2 times, most recently from 34d42a5 to a34efcb Compare November 8, 2018 08:14
tags []*cloudformation.Tag
cfn cloudformationiface.CloudFormationAPI
waitTimeout time.Duration
spec *api.ClusterConfig
Copy link
Contributor Author

@errordeveloper errordeveloper Nov 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still keep a pointer here, but it's arguably more sensible, as there aren't many different kinds of calls to stack manager from the outside, so it's sensible to set it once. It basically gets handed off at this point, and the stack manager is coupled the cluster itself, there isn't a good reason to have it decoupled at this point, unlike the instance of the provider.

Copy link
Contributor

@richardcase richardcase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks good to me, great work. Just a couple of comments.

pkg/eks/api/api.go Outdated Show resolved Hide resolved
type ClusterProvider interface {
CloudFormation() cloudformationiface.CloudFormationAPI
EKS() eksiface.EKSAPI
EC2() ec2iface.EC2API
STS() stsiface.STSAPI
Region() string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need some guidance for contributors when to split out / duplicate fields like we have done with region. I get why its done but its probably something we need to keep an eye on just in case there is a proliferation .

Copy link
Contributor Author

@errordeveloper errordeveloper Nov 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. I wanted to avoid Profile() here, but it's used somewhere and I didn't manage to get rid of it in a sensible manner. We need some guidance here indeed.

@errordeveloper errordeveloper force-pushed the decouple-provider-and-cluster branch from a34efcb to cf310af Compare November 8, 2018 10:21
This refactors how we separate provider configuration and it's recievers
from cluster configuration. We no longer copy cluster configuration in
every places where we need it, instead we pass it explicitly every time.
@errordeveloper errordeveloper force-pushed the decouple-provider-and-cluster branch from cf310af to e86ded8 Compare November 8, 2018 10:56
Copy link
Contributor

@richardcase richardcase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@errordeveloper errordeveloper merged commit 265e6aa into master Nov 8, 2018
@errordeveloper errordeveloper deleted the decouple-provider-and-cluster branch November 8, 2018 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants