Documentation
¶
Index ¶
- Variables
- func FindMatchingObject(haystack []runtime.Object, needle runtime.Object) (runtime.Object, bool)
- func SortByKind(objs []runtime.Object, order Order) []runtime.Object
- func SortInfosByKind(infos []*resource.Info, order Order) []*resource.Info
- func ToInfoList(objs *unstructured.UnstructuredList, mapper meta.RESTMapper) ([]*resource.Info, error)
- func ToObjectList(infos []*resource.Info) []runtime.Object
- type Decoder
- type Encoder
- type Finder
- type Order
- type Serializer
Constants ¶
This section is empty.
Variables ¶
var DefaultSupportedVerbs = metav1.Verbs{"get", "update", "list", "delete", "watch"}
DefaultSupportedVerbs is the list of verbs that is used when a *Finder is created via NewFinder.
Functions ¶
func FindMatchingObject ¶ added in v0.0.2
FindMatching walks haystack and returns the first object matching needle if there is one. The second return value indicates whether the object was found or not.
func SortByKind ¶ added in v0.0.2
SortByKind sorts a slice of runtime.Object in the given order.
func SortInfosByKind ¶ added in v0.0.2
SortInfosByKind sorts a slice of *resource.Info in the given order.
func ToInfoList ¶ added in v0.0.2
func ToInfoList(objs *unstructured.UnstructuredList, mapper meta.RESTMapper) ([]*resource.Info, error)
ToInfoList converts an unstructured.UnstructuredList to a resource info list. The mapper is used to obtain the REST mapping for each object.
Types ¶
type Decoder ¶ added in v0.0.2
type Decoder interface { // Decode decodes raw bytes into slices of runtime.Object. Decode(raw []byte) ([]runtime.Object, error) }
Decoder is the interface of something that can decode raw bytes into slices of runtime.Object.
type Encoder ¶ added in v0.0.2
type Encoder interface { // Encode encodes slices of runtime.Object as bytes. Encode(objs []runtime.Object) ([]byte, error) }
Encoder is the interface for an encoder that encodes multiple objects as slices of bytes.
type Finder ¶ added in v0.0.2
type Finder struct { DiscoveryClient discovery.DiscoveryInterface DynamicClient dynamic.Interface Mapper meta.RESTMapper SupportedVerbs metav1.Verbs }
Finder is a resource finder.
func NewFinder ¶ added in v0.0.2
func NewFinder(client discovery.DiscoveryInterface, dynamicClient dynamic.Interface, mapper meta.RESTMapper) *Finder
NewFinder creates a new *Finder value.
func (*Finder) FindByLabelSelector ¶ added in v0.0.2
FindByLabelSelector finds all resources that match given label selector and returns the resource infos for them. It will only include resources that do at least support the verbs specified in f.SupportedVerbs.
type Order ¶ added in v0.0.2
type Order []string
Order is a slice of strings that defines the ordering of resources.
var ApplyOrder Order = []string{
"Namespace",
"ResourceQuota",
"LimitRange",
"PodSecurityPolicy",
"PodDisruptionBudget",
"Secret",
"ConfigMap",
"StorageClass",
"PersistentVolume",
"PersistentVolumeClaim",
"ServiceAccount",
"CustomResourceDefinition",
"ClusterRole",
"ClusterRoleBinding",
"Role",
"RoleBinding",
"Service",
"DaemonSet",
"Pod",
"ReplicationController",
"ReplicaSet",
"Deployment",
"StatefulSet",
"Job",
"CronJob",
"Ingress",
"APIService",
}
ApplyOrder is the resource order for apply operations.
var DeleteOrder Order = []string{
"APIService",
"Ingress",
"Service",
"CronJob",
"Job",
"StatefulSet",
"Deployment",
"ReplicaSet",
"ReplicationController",
"Pod",
"DaemonSet",
"RoleBinding",
"Role",
"ClusterRoleBinding",
"ClusterRole",
"CustomResourceDefinition",
"ServiceAccount",
"PersistentVolumeClaim",
"PersistentVolume",
"StorageClass",
"ConfigMap",
"Secret",
"PodDisruptionBudget",
"PodSecurityPolicy",
"LimitRange",
"ResourceQuota",
"Namespace",
}
DeleteOrder is the resource order for delete operations.
type Serializer ¶ added in v0.0.2
Serializer can encode and decode slices of runtime.Object.