Documentation ¶
Index ¶
- func AddLabelToDeployment(clientset kubernetes.Interface, origDeployment *v1.Deployment, ...) error
- func AddLabelToPod(clientset kubernetes.Interface, origPod *v1.Pod, key, value, namespace string) error
- func ExecToPodThroughAPI(config *rest.Config, clientset kubernetes.Interface, command []string, ...) (string, string, error)
- func FindOrAppendVolume(volumes *[]v1.Volume, name string) *v1.Volume
- func FindOrAppendVolumeMount(mounts *[]v1.VolumeMount, name string) *v1.VolumeMount
- func IsAlreadyExists(err error) bool
- func IsNotFound(err error) bool
- type Client
- type GetEndpointRequest
- type GetEndpointResponse
- type Interface
- type JSON6902
- type Merge7386
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLabelToDeployment ¶
func AddLabelToDeployment(clientset kubernetes.Interface, origDeployment *v1.Deployment, key, value, namespace string) error
func AddLabelToPod ¶
func ExecToPodThroughAPI ¶
func ExecToPodThroughAPI(config *rest.Config, clientset kubernetes.Interface, command []string, containerName, podName, namespace string, stdin io.Reader) (string, string, error)
ExecToPodThroughAPI uninterractively exec to the pod with the command specified. :param string command: list of the str which specify the command. :param string pod_name: Pod name :param string namespace: namespace of the Pod. :param io.Reader stdin: Standerd Input if necessary, otherwise `nil` :return: string: Output of the command. (STDOUT)
string: Errors. (STDERR) error: If any error has occurred otherwise `nil`
func FindOrAppendVolume ¶
FindOrAppendVolume returns a pointer to the Volume in volumes named name. If no such Volume exists, it creates one with that name and returns it.
func FindOrAppendVolumeMount ¶
func FindOrAppendVolumeMount(mounts *[]v1.VolumeMount, name string) *v1.VolumeMount
FindOrAppendVolumeMount returns a pointer to the VolumeMount in mounts named name. If no such VolumeMount exists, it creates one with that name and returns it.
func IsAlreadyExists ¶
IsAlreadyExists returns true if the err indicates that a resource already exists.
func IsNotFound ¶
IsNotFound returns true if err indicates that a resource was not found.
Types ¶
type Client ¶
type Client struct { *rest.Config *kubernetes.Clientset // contains filtered or unexported fields }
Client provides methods for interacting with Kubernetes resources. It implements both kubernetes and crunchydata clientset Interfaces.
func (*Client) CrunchydataV1 ¶
func (c *Client) CrunchydataV1() crunchydatav1.CrunchydataV1Interface
CrunchydataV1 retrieves the CrunchydataV1Client
type GetEndpointRequest ¶
type GetEndpointRequest struct { Clientset kubernetes.Interface // Kubernetes Clientset that interfaces with the Kubernetes cluster Name string // Name of the endpoint that is being queried Namespace string // Namespace the endpoint being queried resides in }
GetEndpointRequest is used for the GetEndpoint function, which includes the current Kubernetes request context, as well as the namespace / endpoint name being requested
type GetEndpointResponse ¶
type GetEndpointResponse struct { Endpoint *v1.Endpoints // Kubernetes Endpoint object that specifics about the endpoint Name string // Name of the endpoint Namespace string // Namespace that the endpoint is in }
GetEndpointResponse contains the results from a successful request to the endpoint API, including the Kubernetes Endpoint as well as the original request data
func GetEndpoint ¶
func GetEndpoint(request *GetEndpointRequest) (*GetEndpointResponse, error)
GetEndpoint tries to find an individual endpoint in a namespace. Returns the endpoint object if it can be IsNotFound If no endpoint can be found, then an error is returned
type Interface ¶
type Interface interface { kubernetes.Interface CrunchydataV1() crunchydatav1.CrunchydataV1Interface }
type JSON6902 ¶
type JSON6902 []interface{}
JSON6902 represents a JSON Patch according to RFC 6902; the same as k8s.io/apimachinery/pkg/types.JSONPatchType.
func NewJSONPatch ¶
func NewJSONPatch() *JSON6902
NewJSONPatch creates a new JSON Patch according to RFC 6902; the same as k8s.io/apimachinery/pkg/types.JSONPatchType.
func (*JSON6902) Add ¶
Add appends an "add" operation to patch.
> The "add" operation performs one of the following functions, > depending upon what the target location references: > > o If the target location specifies an array index, a new value is > inserted into the array at the specified index. > > o If the target location specifies an object member that does not > already exist, a new member is added to the object. > > o If the target location specifies an object member that does exist, > that member's value is replaced.
func (*JSON6902) Remove ¶
Remove appends a "remove" operation to patch.
> The "remove" operation removes the value at the target location. > > The target location MUST exist for the operation to be successful.
type Merge7386 ¶
type Merge7386 map[string]interface{}
Merge7386 represents a JSON Merge Patch according to RFC 7386; the same as k8s.io/apimachinery/pkg/types.MergePatchType.
func NewMergePatch ¶
func NewMergePatch() *Merge7386
NewMergePatch creates a new JSON Merge Patch according to RFC 7386; the same as k8s.io/apimachinery/pkg/types.MergePatchType.
func (*Merge7386) Add ¶
Add modifies patch to indicate that the member at path should be added or replaced with value.
> If the provided merge patch contains members that do not appear > within the target, those members are added. If the target does > contain the member, the value is replaced. Null values in the merge > patch are given special meaning to indicate the removal of existing > values in the target.