Skip to content

Commit

Permalink
chore: change dynamic.Interface to dynamic.DynamicClient
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
  • Loading branch information
Abhinandan-Purkait committed Nov 7, 2023
1 parent 3e1d184 commit e594a77
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions pkg/kubernetes/client/v1alpha1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,45 +42,51 @@ const (
// to abstract getting kubernetes incluster config
//
// NOTE:
// typed function makes it simple to mock
//
// typed function makes it simple to mock
type getInClusterConfigFn func() (*rest.Config, error)

// buildConfigFromFlagsFn is a typed function
// to abstract getting a kubernetes config from
// provided flags
//
// NOTE:
// typed function makes it simple to mock
//
// typed function makes it simple to mock
type buildConfigFromFlagsFn func(string, string) (*rest.Config, error)

// getKubeMasterIPFromENVFn is a typed function
// to abstract getting kubernetes master IP
// address from environment variable
//
// NOTE:
// typed function makes it simple to mock
//
// typed function makes it simple to mock
type getKubeMasterIPFromENVFn func(env.ENVKey) string

// getKubeConfigPathFromENVFn is a typed function to
// abstract getting kubernetes config path from
// environment variable
//
// NOTE:
// typed function makes it simple to mock
//
// typed function makes it simple to mock
type getKubeConfigPathFromENVFn func(env.ENVKey) string

// getKubeDynamicClientFn is a typed function to
// abstract getting dynamic kubernetes clientset
//
// NOTE:
// typed function makes it simple to mock
type getKubeDynamicClientFn func(*rest.Config) (dynamic.Interface, error)
//
// typed function makes it simple to mock
type getKubeDynamicClientFn func(*rest.Config) (*dynamic.DynamicClient, error)

// getKubeClientsetFn is a typed function
// to abstract getting kubernetes clientset
//
// NOTE:
// typed function makes it simple to mock
//
// typed function makes it simple to mock
type getKubeClientsetFn func(*rest.Config) (*kubernetes.Clientset, error)

// Client provides Kubernetes client operations
Expand Down Expand Up @@ -119,7 +125,9 @@ type Client struct {
// instance
//
// NOTE:
// This is the basic building block to create
//
// This is the basic building block to create
//
// functional operations against the client
// instance
type OptionFn func(*Client)
Expand Down

0 comments on commit e594a77

Please sign in to comment.