fake

package
v0.0.0-...-2cb4bbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL