Documentation ¶
Index ¶
- type Client
- func (c *Client) Apply(m []byte) error
- func (c *Client) Bootstrap() error
- func (c *Client) BuildPath(apiVersion, kind, namespace string) (string, error)
- func (c *Client) CheckCRDCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckDaemonSetCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckDeploymentCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckForwardPodPort(namespace, name string, local, remote int) (bool, error)
- func (c *Client) CheckJobCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckNamespaceCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckPersistentVolumeClaimCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckPodCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckReplicaSetCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckReplicationControllerCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckResourceCleanup(exceptions map[string]bool, scoped bool, absPath ...string) (bool, error)
- func (c *Client) CheckServiceCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CheckStatefulSetCleanup(exceptions map[string]bool) (bool, error)
- func (c *Client) CleanupCRDs(exceptions map[string]bool) error
- func (c *Client) CleanupDaemonSets(exceptions map[string]bool) error
- func (c *Client) CleanupDeployments(exceptions map[string]bool) error
- func (c *Client) CleanupJobs(exceptions map[string]bool) error
- func (c *Client) CleanupNamespaces(exceptions map[string]bool) error
- func (c *Client) CleanupPersistentVolumeClaims(exceptions map[string]bool) error
- func (c *Client) CleanupPods(exceptions map[string]bool) error
- func (c *Client) CleanupReplicaSets(exceptions map[string]bool) error
- func (c *Client) CleanupReplicationControllers(exceptions map[string]bool) error
- func (c *Client) CleanupResource(exceptions map[string]bool, scoped bool, absPath ...string) error
- func (c *Client) CleanupServices(exceptions map[string]bool) error
- func (c *Client) CleanupStatefulSets(exceptions map[string]bool) error
- func (c *Client) CreateNamespace(name string, updateIfExists bool) (*corev1.Namespace, error)
- func (c *Client) CreateSecret(namespace, name string, secretType corev1.SecretType, data map[string][]byte, ...) (*corev1.Secret, error)
- func (c *Client) CreateShoot(shoot *gardenv1beta1.Shoot) (*gardenv1beta1.Shoot, error)
- func (c *Client) Curl(path string) (*rest.Result, error)
- func (c *Client) DeleteConfigMap(namespace, name string) error
- func (c *Client) DeleteDeployment(namespace, name string) error
- func (c *Client) DeleteJob(namespace, name string) error
- func (c *Client) DeleteNamespace(name string) error
- func (c *Client) DeletePod(namespace, name string) error
- func (c *Client) DeleteReplicaSet(namespace, name string) error
- func (c *Client) DeleteSecret(namespace, name string) error
- func (c *Client) DeleteShoot(namespace, name string) error
- func (c *Client) DeleteStatefulSet(namespace, name string) error
- func (c *Client) ForwardPodPort(namespace, name string, local, remote int) (chan struct{}, error)
- func (c *Client) GetAPIResourceList() []*metav1.APIResourceList
- func (c *Client) GetCRD(name string) (*mapping.CustomResourceDefinition, error)
- func (c *Client) GetClientset() *kubernetes.Clientset
- func (c *Client) GetConfig() *rest.Config
- func (c *Client) GetConfigMap(namespace, name string) (*corev1.ConfigMap, error)
- func (c *Client) GetDeployment(namespace, name string) (*mapping.Deployment, error)
- func (c *Client) GetGardenClientset() *gardenclientset.Clientset
- func (c *Client) GetJob(namespace, name string) (*batch_v1.Job, error)
- func (c *Client) GetNamespace(name string) (*corev1.Namespace, error)
- func (c *Client) GetPod(namespace, name string) (*corev1.Pod, error)
- func (c *Client) GetPodLogs(namespace, name string, podLogOptions *corev1.PodLogOptions) (*bytes.Buffer, error)
- func (c *Client) GetRESTClient() rest.Interface
- func (c *Client) GetSecret(namespace, name string) (*corev1.Secret, error)
- func (c *Client) GetService(namespace, name string) (*corev1.Service, error)
- func (c *Client) GetServiceAccount(namespace, name string) (*corev1.ServiceAccount, error)
- func (c *Client) GetShoot(namespace, name string) (*gardenv1beta1.Shoot, error)
- func (c *Client) ListDeployments(namespace string, listOptions metav1.ListOptions) ([]*mapping.Deployment, error)
- func (c *Client) ListNamespaces(selector metav1.ListOptions) (*corev1.NamespaceList, error)
- func (c *Client) ListNodes(listOptions metav1.ListOptions) (*corev1.NodeList, error)
- func (c *Client) ListPods(namespace string, listOptions metav1.ListOptions) (*corev1.PodList, error)
- func (c *Client) ListReplicaSets(namespace string, listOptions metav1.ListOptions) ([]*mapping.ReplicaSet, error)
- func (c *Client) ListResources(scoped bool, absPath []string) ([]byte, error)
- func (c *Client) ListRoleBindings(namespace string, selector metav1.ListOptions) ([]*mapping.RoleBinding, error)
- func (c *Client) ListSecrets(namespace string, listOptions metav1.ListOptions) (*corev1.SecretList, error)
- func (c *Client) ListShoots(namespace string) (*gardenv1beta1.ShootList, error)
- func (c *Client) PatchServiceAccount(namespace, name string, data []byte) (*corev1.ServiceAccount, error)
- func (c *Client) PatchShoot(shoot *gardenv1beta1.Shoot, body []byte) (*gardenv1beta1.Shoot, error)
- func (c *Client) QueryVersion() (string, error)
- func (c *Client) SetClientset(clientset *kubernetes.Clientset)
- func (c *Client) SetConfig(config *rest.Config)
- func (c *Client) SetGardenClientset(client *gardenclientset.Clientset)
- func (c *Client) SetRESTClient(client rest.Interface)
- func (c *Client) UpdateNamespace(name string) (*corev1.Namespace, error)
- func (c *Client) UpdateSecret(namespace, name string, secretType corev1.SecretType, data map[string][]byte) (*corev1.Secret, error)
- func (c *Client) UpdateShoot(shoot *gardenv1beta1.Shoot) (*gardenv1beta1.Shoot, error)
- func (c *Client) UpdateShootStatus(shoot *gardenv1beta1.Shoot) (*gardenv1beta1.Shoot, error)
- func (c *Client) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Config *rest.Config ClientConfig clientcmd.ClientConfig Clientset *kubernetes.Clientset GardenClientset *gardenclientset.Clientset RESTClient rest.Interface // contains filtered or unexported fields }
Client is a struct containing the configuration for the respective Kubernetes cluster, the collection of Kubernetes clients <Clientset> containing all REST clients for the built-in Kubernetes API groups, and the GardenClientset which is a REST clientset for the Garden API group. The RESTClient itself is a normal HTTP client for the respective Kubernetes cluster, allowing requests to arbitrary URLs. The version string contains only the major/minor part in the form <major>.<minor>.
func New ¶
func New(config *rest.Config, clientset *kubernetes.Clientset, clientConfig clientcmd.ClientConfig) (*Client, error)
New returns a new Kubernetes base client.
func (*Client) Apply ¶
Apply is a function which does the same like `kubectl apply -f <file>`. It takes a bunch of manifests <m>, all concatenated in a byte slice, and sends them one after the other to the API server. If a resource already exists at the API server, it will update it. It returns an error as soon as the first error occurs.
func (*Client) Bootstrap ¶
Bootstrap will fetch all Kubernetes server resources, i.e. all registered API groups and the associated resources.
func (*Client) BuildPath ¶
BuildPath creates the Kubernetes API REST URL for the given API group and kind (depending on whether the kind is namespaced or not).
func (*Client) CheckCRDCleanup ¶
CheckCRDCleanup will check whether all the CRDs in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckDaemonSetCleanup ¶
CheckDaemonSetCleanup will check whether all the DaemonSets in the Shoot cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckDeploymentCleanup ¶
CheckDeploymentCleanup will check whether all the Deployments in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckForwardPodPort ¶
CheckForwardPodPort tries to forward the <remote> port of the pod with name <name> in namespace <namespace> to the <local> port. If <local> equals zero, a free port will be chosen randomly. It returns true if the port forward connection has been established successfully or false otherwise.
func (*Client) CheckJobCleanup ¶
CheckJobCleanup will check whether all the Jobs in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckNamespaceCleanup ¶
CheckNamespaceCleanup will check whether all the Namespaces in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckPersistentVolumeClaimCleanup ¶
CheckPersistentVolumeClaimCleanup will check whether all the PersistentVolumeClaims in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckPodCleanup ¶
CheckPodCleanup will check whether all the Pods in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckReplicaSetCleanup ¶
CheckReplicaSetCleanup will check whether all the ReplicaSets in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckReplicationControllerCleanup ¶
CheckReplicationControllerCleanup will check whether all the ReplicationControllers in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckResourceCleanup ¶
func (c *Client) CheckResourceCleanup(exceptions map[string]bool, scoped bool, absPath ...string) (bool, error)
CheckResourceCleanup will check whether all resources except for those in the <exceptions> map have been deleted.
func (*Client) CheckServiceCleanup ¶
CheckServiceCleanup will check whether all the Services in the cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CheckStatefulSetCleanup ¶
CheckStatefulSetCleanup will check whether all the StatefulSets in the Shoot cluster other than those stored in the exceptions map <exceptions> have been deleted. It will return an error in case it has not finished yet, and nil if all resources are gone.
func (*Client) CleanupCRDs ¶
CleanupCRDs deletes all the TPRs/CRDs in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupDaemonSets ¶
CleanupDaemonSets deletes all the DaemonSets in the Shoot cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupDeployments ¶
CleanupDeployments deletes all the Deployments in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupJobs ¶
CleanupJobs deletes all the Jobs in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupNamespaces ¶
CleanupNamespaces deletes all the Namespaces in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupPersistentVolumeClaims ¶
CleanupPersistentVolumeClaims deletes all the PersistentVolumeClaims in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupPods ¶
CleanupPods deletes all the Pods in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupReplicaSets ¶
CleanupReplicaSets deletes all the ReplicaSets in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupReplicationControllers ¶
CleanupReplicationControllers deletes all the ReplicationControllers in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupResource ¶
CleanupResource will delete all resources except for those stored in the <exceptions> map.
func (*Client) CleanupServices ¶
CleanupServices deletes all the Services in the cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CleanupStatefulSets ¶
CleanupStatefulSets deletes all the StatefulSets in the Shoot cluster other than those stored in the exceptions map <exceptions>.
func (*Client) CreateNamespace ¶
CreateNamespace creates a new Namespace object.
func (*Client) CreateSecret ¶
func (c *Client) CreateSecret(namespace, name string, secretType corev1.SecretType, data map[string][]byte, updateIfExists bool) (*corev1.Secret, error)
CreateSecret creates a new Secret object.
func (*Client) CreateShoot ¶
func (c *Client) CreateShoot(shoot *gardenv1beta1.Shoot) (*gardenv1beta1.Shoot, error)
CreateShoot creates a new Shoot resource.
func (*Client) DeleteConfigMap ¶
DeleteConfigMap deletes a ConfigMap object.
func (*Client) DeleteDeployment ¶
DeleteDeployment deletes a Deployment object.
func (*Client) DeleteNamespace ¶
DeleteNamespace deletes a namespace.
func (*Client) DeletePod ¶
DeletePod will delete a Pod with the given <name> in the given <namespace>.
func (*Client) DeleteReplicaSet ¶
DeleteReplicaSet deletes a ReplicaSet object.
func (*Client) DeleteSecret ¶
DeleteSecret deletes an already existing Secret object.
func (*Client) DeleteShoot ¶
DeleteShoot deletes an existing Shoot resource.
func (*Client) DeleteStatefulSet ¶
DeleteStatefulSet deletes a StatefulSet object.
func (*Client) ForwardPodPort ¶
ForwardPodPort tries to forward the <remote> port of the pod with name <name> in namespace <namespace> to the <local> port. If <local> equals zero, a free port will be chosen randomly. It returns the stop channel which must be closed when the port forward connection should be terminated.
func (*Client) GetAPIResourceList ¶
func (c *Client) GetAPIResourceList() []*metav1.APIResourceList
GetAPIResourceList will return the Kubernetes API resource list.
func (*Client) GetCRD ¶
func (c *Client) GetCRD(name string) (*mapping.CustomResourceDefinition, error)
GetCRD returns a CustomResourceDefinition object. For the sake of simplicity, we do not use the APIExtensions client.
func (*Client) GetClientset ¶
func (c *Client) GetClientset() *kubernetes.Clientset
GetClientset will return the Clientset attribute of the Client object.
func (*Client) GetConfigMap ¶
GetConfigMap returns a ConfigMap object.
func (*Client) GetDeployment ¶
func (c *Client) GetDeployment(namespace, name string) (*mapping.Deployment, error)
GetDeployment returns a Deployment object.
func (*Client) GetGardenClientset ¶
func (c *Client) GetGardenClientset() *gardenclientset.Clientset
GetGardenClientset will return the GardenClientset attribute of the Client object.
func (*Client) GetNamespace ¶
GetNamespace returns a Namespace object.
func (*Client) GetPod ¶
GetPod will return the Pod object for the given <name> in the given <namespace>.
func (*Client) GetPodLogs ¶
func (c *Client) GetPodLogs(namespace, name string, podLogOptions *corev1.PodLogOptions) (*bytes.Buffer, error)
GetPodLogs will get the logs of all containers within the Pod for the given <name> in the given <namespace> for the given <podLogOptions>.
func (*Client) GetRESTClient ¶
GetRESTClient will return the RESTClient attribute of the Client object.
func (*Client) GetService ¶
GetService returns the desired Service object.
func (*Client) GetServiceAccount ¶
func (c *Client) GetServiceAccount(namespace, name string) (*corev1.ServiceAccount, error)
GetServiceAccount returns a ServiceAccount object.
func (*Client) GetShoot ¶
func (c *Client) GetShoot(namespace, name string) (*gardenv1beta1.Shoot, error)
GetShoot returns a Shoot resource.
func (*Client) ListDeployments ¶
func (c *Client) ListDeployments(namespace string, listOptions metav1.ListOptions) ([]*mapping.Deployment, error)
ListDeployments returns the list of Deployments in the given <namespace>.
func (*Client) ListNamespaces ¶
func (c *Client) ListNamespaces(selector metav1.ListOptions) (*corev1.NamespaceList, error)
ListNamespaces returns a list of namespaces. The selection can be restricted by passing a <selector>.
func (*Client) ListPods ¶
func (c *Client) ListPods(namespace string, listOptions metav1.ListOptions) (*corev1.PodList, error)
ListPods will list all the Pods in the given <namespace> for the given <listOptions>.
func (*Client) ListReplicaSets ¶
func (c *Client) ListReplicaSets(namespace string, listOptions metav1.ListOptions) ([]*mapping.ReplicaSet, error)
ListReplicaSets returns the list of ReplicaSets in the given <namespace>.
func (*Client) ListResources ¶
ListResources will return a list of Kubernetes resources as JSON byte slice.
func (*Client) ListRoleBindings ¶
func (c *Client) ListRoleBindings(namespace string, selector metav1.ListOptions) ([]*mapping.RoleBinding, error)
ListRoleBindings returns a list of rolebindings in a given <namespace>. The selection can be restricted by passsing an <selector>.
func (*Client) ListSecrets ¶
func (c *Client) ListSecrets(namespace string, listOptions metav1.ListOptions) (*corev1.SecretList, error)
ListSecrets lists all Secrets in a given <namespace>.
func (*Client) ListShoots ¶
func (c *Client) ListShoots(namespace string) (*gardenv1beta1.ShootList, error)
ListShoots returns a list of shoot resources in a given <namespace>.
func (*Client) PatchServiceAccount ¶
func (c *Client) PatchServiceAccount(namespace, name string, data []byte) (*corev1.ServiceAccount, error)
PatchServiceAccount returns the desired Service object.
func (*Client) PatchShoot ¶
func (c *Client) PatchShoot(shoot *gardenv1beta1.Shoot, body []byte) (*gardenv1beta1.Shoot, error)
PatchShoot patches an existing Shoot resource.
func (*Client) QueryVersion ¶
QueryVersion queries the version of the API server and returns the GitVersion (e.g., v1.8.0).
func (*Client) SetClientset ¶
func (c *Client) SetClientset(clientset *kubernetes.Clientset)
SetClientset will set the Clientset attribute of the Client object.
func (*Client) SetGardenClientset ¶
func (c *Client) SetGardenClientset(client *gardenclientset.Clientset)
SetGardenClientset will set the GardenClientset attribute of the Client object.
func (*Client) SetRESTClient ¶
SetRESTClient will set the RESTClient attribute of the Client object.
func (*Client) UpdateNamespace ¶
UpdateNamespace updates an already existing Namespace object.
func (*Client) UpdateSecret ¶
func (c *Client) UpdateSecret(namespace, name string, secretType corev1.SecretType, data map[string][]byte) (*corev1.Secret, error)
UpdateSecret updates an already existing Secret object.
func (*Client) UpdateShoot ¶
func (c *Client) UpdateShoot(shoot *gardenv1beta1.Shoot) (*gardenv1beta1.Shoot, error)
UpdateShoot update an existing Shoot resource.
func (*Client) UpdateShootStatus ¶
func (c *Client) UpdateShootStatus(shoot *gardenv1beta1.Shoot) (*gardenv1beta1.Shoot, error)
UpdateShootStatus update an existing Shoot resource's status.
Source Files ¶
- apply.go
- base.go
- cleanup.go
- client.go
- configmaps.go
- customresourcedefinitions.go
- daemonsets.go
- deployments.go
- jobs.go
- miscellaneous.go
- namespaces.go
- nodes.go
- persistentvolumeclaims.go
- pods.go
- replicasets.go
- replicationcontrollers.go
- rolebindings.go
- secrets.go
- serviceaccounts.go
- services.go
- shoots.go
- statefulsets.go
- types.go