Documentation
¶
Index ¶
- Constants
- func GetRESTConfig(apiServer string, kubeconfig string, kubeconfigContext string) (*rest.Config, string, error)
- func JSONPatch[D any](dest D, fragment string) (o D, err error)
- func MergePatch[D any](dest D, fragment string) (o D, err error)
- func Override[D any](dest D, fragment string, overrideType OverrideType) (o D, err error)
- type Client
- func (c *Client) CreatePod(ctx context.Context, namespace string, pod *types.Pod) (*types.Pod, error)
- func (c *Client) GetPod(ctx context.Context, namespace, name string) (*types.Pod, error)
- func (c *Client) GetPodLogs(ctx context.Context, namespace, name string, opts PodLogOptions) (io.ReadCloser, error)
- func (c *Client) PatchPod(ctx context.Context, namespace, name, subresource string, patchData []byte) (*types.Pod, error)
- func (c *Client) RESTClient() *rest.Config
- func (c *Client) WatchPods(ctx context.Context, namespace string, opts WatchOptions) (*PodWatcher, error)
- type OverrideType
- type PodLogOptions
- type PodWatcher
- type WatchOptions
Constants ¶
View Source
const DefaultOverrideType = OverrideTypeMerge
Variables ¶
This section is empty.
Functions ¶
func GetRESTConfig ¶
func MergePatch ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a minimal Kubernetes REST client
func (*Client) CreatePod ¶
func (c *Client) CreatePod(ctx context.Context, namespace string, pod *types.Pod) (*types.Pod, error)
CreatePod creates a new pod
func (*Client) GetPodLogs ¶
func (c *Client) GetPodLogs(ctx context.Context, namespace, name string, opts PodLogOptions) (io.ReadCloser, error)
GetPodLogs gets logs from a pod container
func (*Client) PatchPod ¶
func (c *Client) PatchPod(ctx context.Context, namespace, name, subresource string, patchData []byte) (*types.Pod, error)
PatchPod patches a pod using JSON Merge Patch
func (*Client) RESTClient ¶
RESTClient returns the underlying REST config (needed for remotecommand)
func (*Client) WatchPods ¶
func (c *Client) WatchPods(ctx context.Context, namespace string, opts WatchOptions) (*PodWatcher, error)
WatchPods watches pods in a namespace
type OverrideType ¶
type OverrideType string
const ( // OverrideTypeJSON will use an RFC6902 JSON Patch to alter the generated output OverrideTypeJSON OverrideType = "json" // OverrideTypeMerge will use an RFC7396 JSON Merge Patch to alter the generated output OverrideTypeMerge OverrideType = "merge" )
type PodLogOptions ¶
PodLogOptions contains options for getting pod logs
type PodWatcher ¶
type PodWatcher struct {
// contains filtered or unexported fields
}
PodWatcher watches changes for pod
func (*PodWatcher) ResultChan ¶
func (w *PodWatcher) ResultChan() <-chan types.PodEvent
ResultChan returns the event channel
type WatchOptions ¶
WatchOptions contains options for watching resources
Click to show internal directories.
Click to hide internal directories.