eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

[Task] Refactor eks.go

Open Himangini opened this issue 3 years ago β€’ 6 comments

Description

This ticket is to refactor the functionality mentioned below and here

eks.go

Contains methods for interacting with clusters. Seems good for this package :heavy_check_mark:

func (c *ClusterProvider) DescribeControlPlane(meta *api.ClusterMeta) (*awseks.Cluster, error)
func (c *ClusterProvider) RefreshClusterStatus(spec *api.ClusterConfig) error
func (c *ClusterProvider) SupportsManagedNodes(clusterConfig *api.ClusterConfig) (bool, error)
func (c *ClusterProvider) SupportsFargate(clusterConfig *api.ClusterConfig) (bool, error)
func (c *ClusterProvider) RefreshClusterStatusIfStale(spec *api.ClusterConfig) error
func (c *ClusterProvider) CanOperate(spec *api.ClusterConfig) (bool, error)
func (c *ClusterProvider) CanOperateWithRefresh(spec *api.ClusterConfig) (bool, error)
func (c *ClusterProvider) CanUpdate(spec *api.ClusterConfig) (bool, error)
func (c *ClusterProvider) ControlPlaneVersion() string
func (c *ClusterProvider) ControlPlaneVPCInfo() awseks.VpcConfigResponse
func (c *ClusterProvider) GetCluster(clusterName string) (*awseks.Cluster, error)
func (c *ClusterProvider) WaitForControlPlane(meta *api.ClusterMeta, clientSet *kubernetes.Clientset) error
func ClusterSupportsManagedNodes(cluster *awseks.Cluster) (bool, error)
func ClusterSupportsFargate(cluster *awseks.Cluster) (bool, error)
func PlatformVersion(platformVersion string) (int, error)

Also contains some stuff not-so related to EKS that should be moved :negative_squared_cross_mark:

func (c *ClusterProvider) NewOpenIDConnectManager(spec *api.ClusterConfig) (*iamoidc.OpenIDConnectManager, error)
func (c *ClusterProvider) LoadClusterIntoSpecFromStack(spec *api.ClusterConfig, stackManager manager.StackManager) error
func (c *ClusterProvider) LoadClusterVPC(spec *api.ClusterConfig, stackManager manager.StackManager) error

Himangini avatar Jul 04 '22 14:07 Himangini

@Himangini Can I work on this?

shogohida avatar Oct 15 '22 14:10 shogohida

@Himangini Can I work on this?

@shogohida we always encourage community contributions πŸŽ‰ please feel free to pick up, we're are happy to help with your PRs ✨

Himangini avatar Oct 17 '22 11:10 Himangini

@Himangini Thanks for your comment! I have a question.

Should I move the functions below to pkg/aws/eks.go?

func (c *ClusterProvider) NewOpenIDConnectManager(spec *api.ClusterConfig) (*iamoidc.OpenIDConnectManager, error)
func (c *ClusterProvider) LoadClusterIntoSpecFromStack(spec *api.ClusterConfig, stackManager manager.StackManager) error
func (c *ClusterProvider) LoadClusterVPC(spec *api.ClusterConfig, stackManager manager.StackManager) error

It seems the explanation here indicates so but I wanted to make sure.

γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2022-10-20 1 45 17

shogohida avatar Oct 19 '22 16:10 shogohida

Is my understanding correct?

https://github.com/weaveworks/eksctl/pull/5810

shogohida avatar Oct 24 '22 05:10 shogohida

Is my understanding correct?

#5810

As mentioned in the description, the functions need to be moved to a relevant place. if you are happy with your changes please open the PR for review πŸ‘πŸ» we are working over a shorter capacity right now but will get your contribution reviewed soon.

Himangini avatar Oct 24 '22 18:10 Himangini

@Himangini Understood. I opened the PR so please review it when you have time!

shogohida avatar Oct 27 '22 02:10 shogohida