testing

package
v0.0.0-...-5bf033e Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigMapGVR = corev1.SchemeGroupVersion.WithResource("configmaps")

ConfigMapGVR is the GroupVersionResource for v1 ConfigMaps.

View Source
var FakeCreationTimestamp = metav1.NewTime(time.Unix(1601548012, 0))

FakeCreationTimestamp is a dummy creation timestamp for test objects.

Functions

func NewConfigMap

func NewConfigMap(ns, name string, data map[string]string) *corev1.ConfigMap

NewConfigMap returns a ConfigMap with the given namespace, name, and data.

func NewUnstructuredConfigMap

func NewUnstructuredConfigMap(ns, name string, data map[string]string) *unstructured.Unstructured

NewUnstructuredConfigMap returns an unstructured.Unstructured object representing a ConfigMap with the given namespace, name, and data.

func SortRuntimeObjects

func SortRuntimeObjects(objects []runtime.Object)

SortRuntimeObjects sorts the given objects by their namespace and name.

Types

type ObjectMap

type ObjectMap map[string][]runtime.Object

ObjectMap represents a map of namespaces to a list of objects.

func (ObjectMap) AllKeys

func (om ObjectMap) AllKeys() (res []string)

AllKeys returns all namespace/name pairs in the map.

func (ObjectMap) KeysForNamespace

func (om ObjectMap) KeysForNamespace(namespace string) (res []string)

KeysForNamespace returns the namespace/name pairs for each object in the given namespace.

func (ObjectMap) Namespaces

func (om ObjectMap) Namespaces() (res []string)

Namespaces returns all the namespaces in the map.

func (ObjectMap) Objects

func (om ObjectMap) Objects() (res []runtime.Object)

Objects returns all the objects in the map.

type SimpleMultiIndexer

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

SimpleMultiIndexer is a simple map of namespace names to a cache.Indexer instance. This satisfies the MultiIndexer interface.

func NewMultiIndexer

func NewMultiIndexer(objects ObjectMap) *SimpleMultiIndexer

NewMultiIndexer returns a new SimpleMultiIndexer with indexers containing the data from the given ObjectMap.

func (*SimpleMultiIndexer) GetIndexers

func (i *SimpleMultiIndexer) GetIndexers() map[string]cache.Indexer

GetIndexers returns the namespace to indexer map.

Jump to

Keyboard shortcuts

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