Documentation ¶
Index ¶
- type Client
- func (c Client) ClusterRole(name string) (*rbacv1.ClusterRole, error)
- func (c Client) ClusterRoleBinding(name string) (*rbacv1.ClusterRoleBinding, error)
- func (c Client) CreateClusterRoleBinding(name string, sa *v1.ServiceAccount, cr *rbacv1.ClusterRole) (*rbacv1.ClusterRoleBinding, error)
- func (c Client) CreateServiceAccount(namespace, name string) (*v1.ServiceAccount, error)
- func (c Client) NodesList() (*v1.NodeList, error)
- func (c Client) PodExec(namespace, podName, containerName string, command ...string) (ReqOutput, error)
- func (c Client) PodsListByLabels(namespace string, labels []string) (*v1.PodList, error)
- func (c Client) ServerVersion() string
- func (c Client) ServiceAccount(namespace, name string) (*v1.ServiceAccount, error)
- type ReqOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Clientset *kubernetes.Clientset Config *rest.Config ServerVersionInfo *version.Info }
Client is a simple k8s api client for testing purposes.
func (Client) ClusterRole ¶
func (c Client) ClusterRole(name string) (*rbacv1.ClusterRole, error)
ClusterRole finds a clusterrole with the given name
func (Client) ClusterRoleBinding ¶
func (c Client) ClusterRoleBinding(name string) (*rbacv1.ClusterRoleBinding, error)
ClusterRoleBinding finds a clusterrolebinding with the given name
func (Client) CreateClusterRoleBinding ¶
func (c Client) CreateClusterRoleBinding(name string, sa *v1.ServiceAccount, cr *rbacv1.ClusterRole) (*rbacv1.ClusterRoleBinding, error)
CreateClusterRoleBinding creates a clusterrolebinding with the given name and links it with the serviceaccount
func (Client) CreateServiceAccount ¶
func (c Client) CreateServiceAccount(namespace, name string) (*v1.ServiceAccount, error)
CreateServiceAccount creates a serviceaccount into the namespace a service account with the given name
func (Client) PodExec ¶
func (c Client) PodExec(namespace, podName, containerName string, command ...string) (ReqOutput, error)
PodExec executes a command on a pod container.
func (Client) PodsListByLabels ¶
PodsListByLabels list pods filtered by labels.
func (Client) ServerVersion ¶
ServerVersion returns the k8s server version.
func (Client) ServiceAccount ¶
func (c Client) ServiceAccount(namespace, name string) (*v1.ServiceAccount, error)
ServiceAccount finds a serviceaccount into the namespace a service account with the given name
Click to show internal directories.
Click to hide internal directories.