eksctl icon indicating copy to clipboard operation
eksctl copied to clipboard

[Task] Move functionality out of api.go and client.go

Open Himangini opened this issue 3 years ago • 0 comments

Description

This ticket is to refactor the functionality mentioned below and here

api.go

Contains:

  • Getters for accessing the AWS APIs, e.g. func (p ProviderServices) EKS() eksiface.EKSAPI { return p.eks }
  • Code for setting up the aws-sdk-go sessions

On the face of it a lot of this isn't really EKS specific but more general AWS related. We should move this out of this package (:heavy_check_mark: added to proposal at the end of the comment)

The rest of file is made up of:

func (c *ClusterProvider) NewStackManager(spec *api.ClusterConfig) manager.StackManager
func (c *ClusterProvider) SetAvailabilityZones(spec *api.ClusterConfig, given []string) error
func ParseConfig(data []byte) (*api.ClusterConfig, error)
func LoadConfigFromFile(configFile string) (*api.ClusterConfig, error)
func ResolveAMI(provider api.ClusterProvider, version string, np api.NodePool) error

None of these functions seem related to EKS specifically, so lets move them.

client.go

Contains code for setting up the aws-sdk-go sessions. Should be moved along side the AWS APIs code.

Himangini avatar Jul 04 '22 14:07 Himangini