Documentation ¶
Index ¶
- Variables
- type GKESDKClient
- func (fgsc *GKESDKClient) CreateCluster(project, region, zone string, rb *container.CreateClusterRequest) error
- func (fgsc *GKESDKClient) CreateClusterAsync(project, region, zone string, rb *container.CreateClusterRequest) (*container.Operation, error)
- func (fgsc *GKESDKClient) DeleteCluster(project, region, zone, clusterName string) error
- func (fgsc *GKESDKClient) DeleteClusterAsync(project, region, zone, clusterName string) (*container.Operation, error)
- func (fgsc *GKESDKClient) GetCluster(project, region, zone, cluster string) (*container.Cluster, error)
- func (fgsc *GKESDKClient) GetOperation(project, region, zone, opName string) (*container.Operation, error)
- func (fgsc *GKESDKClient) ListClustersInProject(project string) ([]*container.Cluster, error)
Constants ¶
This section is empty.
Variables ¶
var ( CreationTimeout = 1000 * time.Millisecond DeletionTimeout = 10 * time.Minute )
Timeout for fake client. Need to be changed dynamically in the tests, so make them public.
Functions ¶
This section is empty.
Types ¶
type GKESDKClient ¶
type GKESDKClient struct { // A lookup table for determining ops statuses OpStatus map[string]string // contains filtered or unexported fields }
GKESDKClient is a fake client for unit tests.
func NewGKESDKClient ¶
func NewGKESDKClient() *GKESDKClient
NewGKESDKClient returns a new fake gkeSDKClient that can be used in unit tests.
func (*GKESDKClient) CreateCluster ¶
func (fgsc *GKESDKClient) CreateCluster( project, region, zone string, rb *container.CreateClusterRequest, ) error
CreateCluster creates a new cluster, and wait until it finishes or timeout or there is an error.
func (*GKESDKClient) CreateClusterAsync ¶
func (fgsc *GKESDKClient) CreateClusterAsync( project, region, zone string, rb *container.CreateClusterRequest, ) (*container.Operation, error)
CreateClusterAsync creates a new cluster asynchronously.
func (*GKESDKClient) DeleteCluster ¶
func (fgsc *GKESDKClient) DeleteCluster( project, region, zone, clusterName string, ) error
DeleteCluster deletes the cluster, and wait until it finishes or timeout or there is an error.
func (*GKESDKClient) DeleteClusterAsync ¶
func (fgsc *GKESDKClient) DeleteClusterAsync( project, region, zone, clusterName string, ) (*container.Operation, error)
DeleteClusterAsync deletes the cluster asynchronously.
func (*GKESDKClient) GetCluster ¶
func (fgsc *GKESDKClient) GetCluster(project, region, zone, cluster string) (*container.Cluster, error)
GetCluster gets the cluster with the given settings.
func (*GKESDKClient) GetOperation ¶
func (fgsc *GKESDKClient) GetOperation(project, region, zone, opName string) (*container.Operation, error)
GetOperation gets the operation with the given settings.
func (*GKESDKClient) ListClustersInProject ¶
func (fgsc *GKESDKClient) ListClustersInProject(project string) ([]*container.Cluster, error)
ListClustersInProject lists all the GKE clusters created in the given project.