package pod

import "k8s.io/kubernetes/pkg/registry/core/pod"

Package pod provides Registry interface and it's RESTStorage implementation for storing Pod api objects.

Index

Variables

var EphemeralContainersStrategy = podEphemeralContainersStrategy{
	// contains filtered or unexported fields
}

EphemeralContainersStrategy wraps and exports the used podStrategy for the storage package.

var ResizeStrategy = podResizeStrategy{
	// contains filtered or unexported fields
}

ResizeStrategy wraps and exports the used podStrategy for the storage package.

var StatusStrategy = podStatusStrategy{Strategy}

StatusStrategy wraps and exports the used podStrategy for the storage package.

var Strategy = podStrategy{legacyscheme.Scheme, names.SimpleNameGenerator}

Strategy is the default logic that applies when creating and updating Pod objects via the REST API.

Functions

func AttachLocation

func AttachLocation(
	ctx context.Context,
	getter ResourceGetter,
	connInfo client.ConnectionInfoGetter,
	name string,
	opts *api.PodAttachOptions,
) (*url.URL, http.RoundTripper, error)

AttachLocation returns the attach URL for a pod container. If opts.Container is blank and only one container is present in the pod, that container is used.

func ExecLocation

func ExecLocation(
	ctx context.Context,
	getter ResourceGetter,
	connInfo client.ConnectionInfoGetter,
	name string,
	opts *api.PodExecOptions,
) (*url.URL, http.RoundTripper, error)

ExecLocation returns the exec URL for a pod container. If opts.Container is blank and only one container is present in the pod, that container is used.

func GetAttrs

func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error)

GetAttrs returns labels and fields of a given object for filtering purposes.

func Indexers

func Indexers() *cache.Indexers

Indexers returns the indexers for pod storage.

func LogLocation

func LogLocation(
	ctx context.Context, getter ResourceGetter,
	connInfo client.ConnectionInfoGetter,
	name string,
	opts *api.PodLogOptions,
) (*url.URL, http.RoundTripper, error)

LogLocation returns the log URL for a pod container. If opts.Container is blank and only one container is present in the pod, that container is used.

func MatchPod

MatchPod returns a generic matcher for a given label and field selector.

func NamespaceIndexFunc

func NamespaceIndexFunc(obj interface{}) ([]string, error)

NamespaceIndexFunc return value name of given object.

func NodeNameIndexFunc

func NodeNameIndexFunc(obj interface{}) ([]string, error)

NodeNameIndexFunc return value spec.nodename of given object.

func NodeNameTriggerFunc

func NodeNameTriggerFunc(obj runtime.Object) string

NodeNameTriggerFunc returns value spec.nodename of given object.

func PortForwardLocation

func PortForwardLocation(
	ctx context.Context,
	getter ResourceGetter,
	connInfo client.ConnectionInfoGetter,
	name string,
	opts *api.PodPortForwardOptions,
) (*url.URL, http.RoundTripper, error)

PortForwardLocation returns the port-forward URL for a pod.

func ResourceLocation

func ResourceLocation(ctx context.Context, getter ResourceGetter, rt http.RoundTripper, id string) (*url.URL, http.RoundTripper, error)

ResourceLocation returns a URL to which one can send traffic for the specified pod.

func ToSelectableFields

func ToSelectableFields(pod *api.Pod) fields.Set

ToSelectableFields returns a field set that represents the object TODO: fields are not labels, and the validation rules for them do not apply.

Types

type ResourceGetter

type ResourceGetter interface {
	Get(context.Context, string, *metav1.GetOptions) (runtime.Object, error)
}

ResourceGetter is an interface for retrieving resources by ResourceLocation.

Source Files

doc.go strategy.go

Directories

PathSynopsis
pkg/registry/core/pod/rest
pkg/registry/core/pod/storage
Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
35 packages
Last checked
3 hours ago

Tools for package owners.