kubernetes/staging/src/k8s.io/client-go/testing/fixture.go

type ObjectTracker

type ObjectScheme

// ObjectReaction returns a ReactionFunc that applies core.Action to
// the given tracker.
//
// If tracker also implements ManagedFieldObjectTracker, then managed fields
// will be handled by the tracker and apply patch actions will be evaluated
// using the field manager and will take field ownership into consideration.
// Without a ManagedFieldObjectTracker, apply patch actions do not consider
// field ownership.
//
// WARNING: There is no server side defaulting, validation, or conversion handled
// by the fake client and subresources are not handled accurately (fields in the
// root resource are not automatically updated when a scale resource is updated, for example).
func ObjectReaction(tracker ObjectTracker) ReactionFunc {}

type objectTrackerReact

func (o objectTrackerReact) List(action ListActionImpl) (runtime.Object, error) {}

func (o objectTrackerReact) Get(action GetActionImpl) (runtime.Object, error) {}

func (o objectTrackerReact) Create(action CreateActionImpl) (runtime.Object, error) {}

func (o objectTrackerReact) Update(action UpdateActionImpl) (runtime.Object, error) {}

func (o objectTrackerReact) Delete(action DeleteActionImpl) (runtime.Object, error) {}

func (o objectTrackerReact) Apply(action PatchActionImpl) (runtime.Object, error) {}

func (o objectTrackerReact) Patch(action PatchActionImpl) (runtime.Object, error) {}

type tracker

var _

// NewObjectTracker returns an ObjectTracker that can be used to keep track
// of objects for the fake clientset. Mostly useful for unit tests.
func NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracker {}

func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string, opts ...metav1.ListOptions) (runtime.Object, error) {}

func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string, opts ...metav1.ListOptions) (watch.Interface, error) {}

func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.GetOptions) (runtime.Object, error) {}

func (t *tracker) Add(obj runtime.Object) error {}

func (t *tracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.CreateOptions) error {}

func (t *tracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.UpdateOptions) error {}

func (t *tracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, opts ...metav1.PatchOptions) error {}

func (t *tracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, opts ...metav1.PatchOptions) error {}

func (t *tracker) getWatches(gvr schema.GroupVersionResource, ns string) []*watch.RaceFreeFakeWatcher {}

func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns string, replaceExisting bool) error {}

func (t *tracker) addList(obj runtime.Object, replaceExisting bool) error {}

func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.DeleteOptions) error {}

type managedFieldObjectTracker

var _

// NewFieldManagedObjectTracker returns an ObjectTracker that can be used to keep track
// of objects and managed fields for the fake clientset. Mostly useful for unit tests.
func NewFieldManagedObjectTracker(scheme *runtime.Scheme, decoder runtime.Decoder, typeConverter managedfields.TypeConverter) ObjectTracker {}

func (t *managedFieldObjectTracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.CreateOptions) error {}

func (t *managedFieldObjectTracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.UpdateOptions) error {}

func (t *managedFieldObjectTracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, vopts ...metav1.PatchOptions) error {}

func (t *managedFieldObjectTracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, vopts ...metav1.PatchOptions) error {}

func (t *managedFieldObjectTracker) fieldManagerFor(gvk schema.GroupVersionKind) (*managedfields.FieldManager, error) {}

type objectDefaulter

func (d *objectDefaulter) Default(_ runtime.Object) {}

// filterByNamespace returns all objects in the collection that
// match provided namespace. Empty namespace matches
// non-namespaced objects.
func filterByNamespace(objs map[types.NamespacedName]runtime.Object, ns string) ([]runtime.Object, error) {}

func DefaultWatchReactor(watchInterface watch.Interface, err error) WatchReactionFunc {}

type SimpleReactor

func (r *SimpleReactor) Handles(action Action) bool {}

func (r *SimpleReactor) React(action Action) (bool, runtime.Object, error) {}

type SimpleWatchReactor

func (r *SimpleWatchReactor) Handles(action Action) bool {}

func (r *SimpleWatchReactor) React(action Action) (bool, watch.Interface, error) {}

type SimpleProxyReactor

func (r *SimpleProxyReactor) Handles(action Action) bool {}

func (r *SimpleProxyReactor) React(action Action) (bool, restclient.ResponseWrapper, error) {}

func resourceCovers(resource string, action Action) bool {}

// assertOptionalSingleArgument returns an error if there is more than one variadic argument.
// Otherwise, it returns the first variadic argument, or zero value if there are no arguments.
func assertOptionalSingleArgument[T any](arguments []T) (T, error) {}

type TypeResolver

type TypeConverter

func (tc TypeConverter) ObjectToTyped(obj runtime.Object, opts ...typed.ValidationOptions) (*typed.TypedValue, error) {}

func (tc TypeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) {}

func (tc TypeConverter) openAPIName(kind schema.GroupVersionKind) (string, error) {}

// This is a copy of openapi.friendlyName.
// TODO: consider introducing a shared version of this function in apimachinery.
func friendlyName(name string) string {}