client

package
v0.0.0-...-e40a182 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	clusterext.Extension
	// contains filtered or unexported fields
}

Client object for all operations

func GetConfigClient

func GetConfigClient(paths []string) *Client

GetConfigClient returns a client with a specific kubeconfig path

func GetDefaultConfigClient

func GetDefaultConfigClient() *Client

GetDefaultConfigClient returns a functioning client from the default kubeconfig path

func GetFakeConfigClient

func GetFakeConfigClient(clusters map[string][]runtime.Object) *Client

GetFakeConfigClient returns a fake client with the objects in the clusters specified

func GetPlaceholderClient

func GetPlaceholderClient() *Client

GetPlaceholderClient returns an empty client

func (*Client) AttachLabelForger

func (c *Client) AttachLabelForger(m map[string]map[string]string)

AttachLabelForger creates and adds an Extension to the client

func (*Client) DeleteConfigMap

func (c *Client) DeleteConfigMap(contextStr, namespace, name string, options DeleteOptions) error

DeleteConfigMap deletes a single configmap. Requires exact location.

func (*Client) DeleteCronJob

func (c *Client) DeleteCronJob(contextStr, namespace, name string, options DeleteOptions) error

DeleteCronJob deletes a single cronjob. Requires exact location.

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(contextStr, namespace, name string, options DeleteOptions) error

DeleteDeployment deletes a single deployment. Requires exact location.

func (*Client) DeleteJob

func (c *Client) DeleteJob(contextStr, namespace, name string, options DeleteOptions) error

DeleteJob deletes a single job. Requires exact location.

func (*Client) DeletePod

func (c *Client) DeletePod(contextStr, namespace, name string, options DeleteOptions) error

DeletePod deletes a single pod. Requires exact location.

func (*Client) DeleteReplicaSet

func (c *Client) DeleteReplicaSet(contextStr, namespace, name string, options DeleteOptions) error

DeleteReplicaSet deletes a single replicaset. Requires exact location.

func (*Client) DescribeConfigMap

func (c *Client) DescribeConfigMap(configmap types.ConfigMapDiscovery, options DescribeOptions) (string, error)

DescribeConfigMap returns a human readable format to describe the configmap

func (*Client) DescribeCronJob

func (c *Client) DescribeCronJob(cronjob types.CronJobDiscovery, options DescribeOptions) (string, error)

DescribeCronJob returns a human readable format to describe the cronjob

func (*Client) DescribeDeployment

func (c *Client) DescribeDeployment(deployment types.DeploymentDiscovery, options DescribeOptions) (string, error)

DescribeDeployment returns a human readable format to describe the deployment

func (*Client) DescribeJob

func (c *Client) DescribeJob(job types.JobDiscovery, options DescribeOptions) (string, error)

DescribeJob returns a human readable format to describe the job

func (*Client) DescribePod

func (c *Client) DescribePod(pod types.PodDiscovery, options DescribeOptions) (string, error)

DescribePod returns a human readable format to describe the pod

func (*Client) DescribeReplicaSet

func (c *Client) DescribeReplicaSet(replicaset types.ReplicaSetDiscovery, options DescribeOptions) (string, error)

DescribeReplicaSet returns a human readable format to describe the replicaset

func (*Client) ExecInPod

func (c *Client) ExecInPod(contexts []string, namespace, name, container string, options ListOptions, commands []string, stdin io.Reader, stdout, stderr io.Writer) error

ExecInPod executes a command on a pod interactively

func (*Client) FindAdhocJob

func (c *Client) FindAdhocJob(appName string, options ListOptions) (*types.JobDiscovery, error)

FindAdhocJob loops through all valid contexts and returns the first active job found

func (*Client) FindAdhocPodAndAppDetails

func (c *Client) FindAdhocPodAndAppDetails(appName string, options ListOptions) (*types.PodDiscovery, *types.ManifestDetails, *types.RunDetails, error)

FindAdhocPodAndAppDetails loops through all valid contexts and returns the first adhoc pod found along with context details about the pod

func (*Client) FindConfigMaps

func (c *Client) FindConfigMaps(contexts []string, namespace string, names []string, options ListOptions) ([]types.ConfigMapDiscovery, error)

FindConfigMaps simultaneously searches for multiple configmaps and returns all results

func (*Client) FindCronJobs

func (c *Client) FindCronJobs(contexts []string, namespace string, names []string, options ListOptions) ([]types.CronJobDiscovery, error)

FindCronJobs simultaneously searches for multiple cron jobs and returns all results

func (*Client) FindDeployments

func (c *Client) FindDeployments(contexts []string, namespace string, names []string, options ListOptions) ([]types.DeploymentDiscovery, error)

FindDeployments simultaneously searches for multiple deployments and returns all results

func (*Client) FindJobs

func (c *Client) FindJobs(contexts []string, namespace string, names []string, options ListOptions) ([]types.JobDiscovery, error)

FindJobs simultaneously searches for multiple jobs and returns all results

func (*Client) FindPodWithContainer

func (c *Client) FindPodWithContainer(contexts []string, namespace, name, optionalContainer string, options ListOptions) (pod *types.PodDiscovery, container string, err error)

FindPodWithContainer returns a pod with a container. If multiple containers are available and none is specified, then the first one is returned.

func (*Client) FindPods

func (c *Client) FindPods(contexts []string, namespace string, names []string, options ListOptions) ([]types.PodDiscovery, error)

FindPods simultaneously searches for multiple pods and returns all results

func (*Client) FindReplicaSets

func (c *Client) FindReplicaSets(contexts []string, namespace string, names []string, options ListOptions) ([]types.ReplicaSetDiscovery, error)

FindReplicaSets simultaneously searches for multiple configmaps and returns all results

func (*Client) GetConfigMap

func (c *Client) GetConfigMap(contextStr, namespace string, name string, options GetOptions) (*types.ConfigMapDiscovery, error)

GetConfigMap returns a single configmap

func (*Client) GetCronJob

func (c *Client) GetCronJob(contextStr, namespace string, name string, options GetOptions) (*types.CronJobDiscovery, error)

GetCronJob returns a single cron job

func (*Client) GetCtlExt

func (c *Client) GetCtlExt() map[string]map[string]string

GetCtlExt returns the ctl extensions for each cluster It maps context (cluster name) -> ConfigMap data Return data: no entry for couldn't connect, nil for couldn't open, else actual data

func (*Client) GetDeployment

func (c *Client) GetDeployment(contextStr, namespace string, name string, options GetOptions) (*types.DeploymentDiscovery, error)

GetDeployment returns a single deployment

func (*Client) GetJob

func (c *Client) GetJob(contextStr, namespace string, name string, options GetOptions) (*types.JobDiscovery, error)

GetJob returns a single job

func (*Client) GetPod

func (c *Client) GetPod(contextStr, namespace string, name string, options GetOptions) (*types.PodDiscovery, error)

GetPod returns a single pod

func (*Client) GetReplicaSet

func (c *Client) GetReplicaSet(contextStr, namespace string, name string, options GetOptions) (*types.ReplicaSetDiscovery, error)

GetReplicaSet returns a single replicaset

func (*Client) ListConfigMaps

func (c *Client) ListConfigMaps(contextStr string, namespace string, options ListOptions) ([]types.ConfigMapDiscovery, error)

ListConfigMaps returns a list of all configmap that match the query

func (*Client) ListConfigMapsOverContexts

func (c *Client) ListConfigMapsOverContexts(contexts []string, namespace string, options ListOptions) ([]types.ConfigMapDiscovery, error)

ListConfigMapsOverContexts is like ListConfigMaps but operates over multiple clusters

func (*Client) ListCronJobs

func (c *Client) ListCronJobs(contextStr string, namespace string, options ListOptions) ([]types.CronJobDiscovery, error)

ListCronJobs returns a list of all cron jobs that match the query

func (*Client) ListCronJobsOverContexts

func (c *Client) ListCronJobsOverContexts(contexts []string, namespace string, options ListOptions) ([]types.CronJobDiscovery, error)

ListCronJobsOverContexts is like ListCronJobs but operates over multiple clusters

func (*Client) ListDeployments

func (c *Client) ListDeployments(contextStr string, namespace string, options ListOptions) ([]types.DeploymentDiscovery, error)

ListDeployments returns a list of all deployments that match the query

func (*Client) ListDeploymentsOverContexts

func (c *Client) ListDeploymentsOverContexts(contexts []string, namespace string, options ListOptions) ([]types.DeploymentDiscovery, error)

ListDeploymentsOverContexts is like ListDeployments but operates over multiple clusters

func (*Client) ListJobs

func (c *Client) ListJobs(contextStr string, namespace string, options ListOptions) ([]types.JobDiscovery, error)

ListJobs returns a list of all jobs that match the query

func (*Client) ListJobsOfCronJob

func (c *Client) ListJobsOfCronJob(contexts []string, namespace, cronjobName string, options ListOptions) ([]types.JobDiscovery, error)

ListJobsOfCronJob returns a list of all jobs belonging to a cron job

func (*Client) ListJobsOverContexts

func (c *Client) ListJobsOverContexts(contexts []string, namespace string, options ListOptions) ([]types.JobDiscovery, error)

ListJobsOverContexts is like ListJobs but operates over multiple clusters

func (*Client) ListPods

func (c *Client) ListPods(contextStr string, namespace string, options ListOptions) ([]types.PodDiscovery, error)

ListPods returns a list of all pod that match the query

func (*Client) ListPodsOfJob

func (c *Client) ListPodsOfJob(contexts []string, namespace, jobName string, options ListOptions) ([]types.PodDiscovery, error)

ListPodsOfJob returns a list of all pods belonging to a job

func (*Client) ListPodsOverContexts

func (c *Client) ListPodsOverContexts(contexts []string, namespace string, options ListOptions) ([]types.PodDiscovery, error)

ListPodsOverContexts is like ListPods but operates over multiple clusters

func (*Client) ListReplicaSets

func (c *Client) ListReplicaSets(contextStr string, namespace string, options ListOptions) ([]types.ReplicaSetDiscovery, error)

ListReplicaSets returns a list of all replicaset that match the query

func (*Client) ListReplicaSetsOverContexts

func (c *Client) ListReplicaSetsOverContexts(contexts []string, namespace string, options ListOptions) ([]types.ReplicaSetDiscovery, error)

ListReplicaSetsOverContexts is like ListReplicaSets but operates over multiple clusters

func (*Client) LogPod

func (c *Client) LogPod(context, namespace, name, container string, options LogOptions) (*rest.Request, error)

LogPod retrieves logs from a container of a pod. Operates on the first container if none specified. TODO: The usage of this function is odd (support all containers???)

func (*Client) LogPodOverContexts

func (c *Client) LogPodOverContexts(contexts []string, namespace, name, container string, options LogOptions) (*rest.Request, error)

LogPodOverContexts retrieves logs of a single pod (uses first found if multiple)

func (*Client) LogPodsOverContexts

func (c *Client) LogPodsOverContexts(contexts []string, namespace, container string, options LogOptions) (io.Reader, error)

LogPodsOverContexts retrieves logs of multiple pods (uses first found if multiple)

func (*Client) RunCronJob

func (c *Client) RunCronJob(contexts []string, namespace, cronjobName string, options ListOptions) (*types.JobDiscovery, error)

RunCronJob creates a new job with timestamp from the specified cron job template

func (*Client) SetCronJobSuspend

func (c *Client) SetCronJobSuspend(contextStr, namespace, name string, suspend bool) (bool, error)

SetCronJobSuspend sets the cron job suspend state to given value and reports whether successful. Does nothing (and returns false) if the cronjob is already in the correct state.

type DeleteOptions

type DeleteOptions struct {
	// When set, the resource is deleted immediately by setting GracePeriodSeconds to 0.
	Now                 bool
	DeletionPropagation bool
}

DeleteOptions is used to specify conditions on deleting a resource

type DescribeOptions

type DescribeOptions struct {
	ShowEvents bool
}

DescribeOptions is used to specify how to describe a resource

type GetOptions

type GetOptions struct {
	// Filtering by labels
	filter.LabelMatch
}

GetOptions is used to specify filtering on get operations

type ListOptions

type ListOptions struct {
	// Filtering by labels
	filter.LabelMatch
	// Filtering by status
	filter.StatusMatch
	// Filtering by name
	Search *regexp.Regexp
}

ListOptions is used to specify filtering on list operations

type LogOptions

type LogOptions struct {
	// Filtering by labels
	filter.LabelMatch
	// Filtering by status
	filter.StatusMatch
	// When set streams logs
	Follow bool
	// Filtering by name
	Search *regexp.Regexp
	// When set, adds a RFC3339Nano timestamp to the beginning of each line
	Timestamps bool
}

LogOptions is used to specify filtering on log operations

type StaticContextsGetter

type StaticContextsGetter struct {
	// contains filtered or unexported fields
}

StaticContextsGetter returns a static list of contexts. This struct implements the contextsGetter interface

func (StaticContextsGetter) GetAllContexts

func (s StaticContextsGetter) GetAllContexts() []string

GetAllContexts returns the list of all the clusters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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