Documentation ¶
Index ¶
- Constants
- func FakeNew() (*Client, *FakeClientset)
- func GenerateContainer(name, image string, isPrivileged bool, command, args []string, ...) *corev1.Container
- func GenerateDeploymentSpec(podTemplateSpec corev1.PodTemplateSpec) *appsv1.DeploymentSpec
- func GeneratePodTemplateSpec(podName, namespace, serviceAccountName string, labels map[string]string, ...) *corev1.PodTemplateSpec
- type Client
- func (c *Client) CreateDeployment(name string, deploymentSpec appsv1.DeploymentSpec) (*appsv1.Deployment, error)
- func (c *Client) ExecCMDInContainer(podName, containerName string, cmd []string, stdout io.Writer, ...) error
- func (c *Client) WaitAndGetPod(watchOptions metav1.ListOptions, desiredPhase corev1.PodPhase, ...) (*corev1.Pod, error)
- type FakeClientset
Constants ¶
const ( DeploymentKind = "Deployment" DeploymentAPIVersion = "apps/v1" )
constants for deployments
Variables ¶
This section is empty.
Functions ¶
func FakeNew ¶
func FakeNew() (*Client, *FakeClientset)
FakeNew creates new fake client for testing returns Client that is filled with fake clients and FakeClientSet that holds fake Clientsets to access Actions, Reactors etc... in fake client
func GenerateContainer ¶
func GenerateContainer(name, image string, isPrivileged bool, command, args []string, envVars []corev1.EnvVar) *corev1.Container
GenerateContainer creates a container spec that can be used when creating a pod
func GenerateDeploymentSpec ¶
func GenerateDeploymentSpec(podTemplateSpec corev1.PodTemplateSpec) *appsv1.DeploymentSpec
GenerateDeploymentSpec creates a deployment spec
func GeneratePodTemplateSpec ¶
func GeneratePodTemplateSpec(podName, namespace, serviceAccountName string, labels map[string]string, containers []corev1.Container) *corev1.PodTemplateSpec
GeneratePodTemplateSpec creates a pod template spec that can be used to create a deployment spec
Types ¶
type Client ¶
type Client struct { KubeClient kubernetes.Interface KubeConfig clientcmd.ClientConfig KubeClientConfig *rest.Config Namespace string }
Client is a collection of fields used for client configuration and interaction
func (*Client) CreateDeployment ¶
func (c *Client) CreateDeployment(name string, deploymentSpec appsv1.DeploymentSpec) (*appsv1.Deployment, error)
CreateDeployment creates a deployment based on the given deployment spec
func (*Client) ExecCMDInContainer ¶
func (c *Client) ExecCMDInContainer(podName, containerName string, cmd []string, stdout io.Writer, stderr io.Writer, stdin io.Reader, tty bool) error
ExecCMDInContainer execute command in the container of a pod, pass an empty string for containerName to execute in the first container of the pod
type FakeClientset ¶
type FakeClientset struct {
Kubernetes *fakeKubeClientset.Clientset
}
FakeClientset holds fake ClientSets this is returned by FakeNew to access methods of fake client sets