Documentation
¶
Overview ¶
Package kube provides steps implementations related to Kubernetes.
Index ¶
- Constants
- type Client
- func (kc *Client) AKubernetesCluster() error
- func (kc *Client) ClusterRbacIsFound(resource, name string) error
- func (kc *Client) DeleteAllTestResources() error
- func (kc *Client) MultiResourceOperation(operation, resourceFileName string) error
- func (kc *Client) NodesWithSelectorShouldBe(n int, selector, state string) error
- func (kc *Client) ResourceConditionShouldBe(resourceFileName, cType, status string) error
- func (kc *Client) ResourceInNamespace(resource, name, ns string) error
- func (kc *Client) ResourceOperation(operation, resourceFileName string) error
- func (kc *Client) ResourceShouldBe(resourceFileName, state string) error
- func (kc *Client) ResourceShouldConvergeToSelector(resourceFileName, selector string) error
- func (kc *Client) ScaleDeployment(name, ns string, replica int32) error
- func (kc *Client) UpdateResourceWithField(resourceFileName, key string, value string) error
Constants ¶
const ( OperationCreate = "create" OperationSubmit = "submit" OperationUpdate = "update" OperationDelete = "delete" ResourceStateCreated = "created" ResourceStateDeleted = "deleted" NodeStateReady = "ready" NodeStateFound = "found" DefaultWaiterInterval = time.Second * 30 DefaultWaiterTries = 40 DefaultFilePath = "templates" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { KubeInterface kubernetes.Interface DynamicInterface dynamic.Interface DiscoveryInterface discovery.DiscoveryInterface FilesPath string TemplateArguments interface{} WaiterInterval time.Duration WaiterTries int }
func (*Client) AKubernetesCluster ¶
AKubernetesCluster sets the Kubernetes clients given a valid kube config file in ~/.kube or the path set in the environment variable KUBECONFIG.
func (*Client) ClusterRbacIsFound ¶ added in v0.4.0
func (*Client) DeleteAllTestResources ¶
DeleteAllTestResources deletes all the resources defined by yaml files in the path given by FilesPath, if FilesPath is empty, it will look for the files in ./templates. Meant to be use in the before/after suite/scenario/step hooks
func (*Client) MultiResourceOperation ¶ added in v0.2.0
MultiResourceOperation performs the given operation on the resources defined in resourceFileName. The operation could be “create”, “submit” or “delete”. Files created using this function cannot individually be addressed by filename.
func (*Client) NodesWithSelectorShouldBe ¶
NodesWithSelectorShouldBe checks that n amount of nodes with the given selector are in the desired state. It retries every 30 seconds for a total of 40 times. Selector in the form <key>=<value>, the state can be "ready" or "found".
func (*Client) ResourceConditionShouldBe ¶
ResourceConditionShouldBe checks that the resource defined in resourceFileName has the condition of type cType in the desired status. It retries every 30 seconds for a total of 40 times.
func (*Client) ResourceInNamespace ¶ added in v0.3.0
ResourceInNamespace check if (deployment|service) in the related namespace
func (*Client) ResourceOperation ¶
ResourceOperation performs the given operation on the resource defined in resourceFileName. The operation could be “create”, “submit” or “delete”.
func (*Client) ResourceShouldBe ¶
ResourceShouldBe checks if the resource defined in resourceFileName is in the desired state. It retries every 30 seconds for a total of 40 times. The state could be “created” or “deleted”.
func (*Client) ResourceShouldConvergeToSelector ¶
ResourceShouldConvergeToSelector checks if the resource defined in resourceFileName has the desired selector. It retries every 30 seconds for a total of 40 times. Selector in the form <keys>=<value>.
func (*Client) ScaleDeployment ¶ added in v0.0.2
ScaleDeployment scale up/down for the deployment