Documentation ¶
Index ¶
- Variables
- func ConvertToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
- func ConvertUnstructured(res *unstructured.Unstructured) (runtime.Object, error)
- func GetPatch(obj1, obj2 *unstructured.Unstructured) ([]byte, error)
- func Match(ctx context.Context, obj1, obj2 *unstructured.Unstructured) bool
- func Patch(obj *unstructured.Unstructured, patchJson []byte) error
- type ClusterResourceFetcher
- type FilterResource
- type ResourceKey
- type UnstructuredResources
- func (urs UnstructuredResources) ByKey() UnstructuredResourcesByKey
- func (urs UnstructuredResources) Filter(filter func(resource *unstructured.Unstructured) bool) UnstructuredResources
- func (urs UnstructuredResources) GroupedByGVK() []VersionedResources
- func (urs UnstructuredResources) Sort() UnstructuredResources
- func (urs UnstructuredResources) WithLabels(targetLabels map[string]string) UnstructuredResources
- type UnstructuredResourcesByKey
- type VersionedResources
Constants ¶
This section is empty.
Variables ¶
var InstallOrder = []string{
"Namespace",
"NetworkPolicy",
"ResourceQuota",
"LimitRange",
"PodSecurityPolicy",
"PodDisruptionBudget",
"Secret",
"ConfigMap",
"StorageClass",
"PersistentVolume",
"PersistentVolumeClaim",
"ServiceAccount",
"CustomResourceDefinition",
"ClusterRole",
"ClusterRoleList",
"ClusterRoleBinding",
"ClusterRoleBindingList",
"Role",
"RoleList",
"RoleBinding",
"RoleBindingList",
"Service",
"DaemonSet",
"Pod",
"ReplicationController",
"ReplicaSet",
"Deployment",
"HorizontalPodAutoscaler",
"StatefulSet",
"Job",
"CronJob",
"Ingress",
"APIService",
}
InstallOrder is the order in which manifests should be installed (by Kind).
Those occurring earlier in the list get installed before those occurring later in the list.
Functions ¶
func ConvertToUnstructured ¶
func ConvertToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
func ConvertUnstructured ¶
func ConvertUnstructured(res *unstructured.Unstructured) (runtime.Object, error)
func GetPatch ¶
func GetPatch(obj1, obj2 *unstructured.Unstructured) ([]byte, error)
func Match ¶
func Match(ctx context.Context, obj1, obj2 *unstructured.Unstructured) bool
returns true if there is a difference between the objects, after having zeroed out note that this function updates the object for writing, which is fine as it zeroes out statuses and generated fields
func Patch ¶
func Patch(obj *unstructured.Unstructured, patchJson []byte) error
Types ¶
type ClusterResourceFetcher ¶
type ClusterResourceFetcher struct {
// contains filtered or unexported fields
}
type FilterResource ¶
type FilterResource func(schema.GroupVersionResource) bool
type ResourceKey ¶
type ResourceKey struct { Gvk schema.GroupVersionKind Namespace, Name string }
func Key ¶
func Key(obj *unstructured.Unstructured) ResourceKey
func (ResourceKey) String ¶
func (k ResourceKey) String() string
type UnstructuredResources ¶
type UnstructuredResources []*unstructured.Unstructured
func GetClusterResources ¶
func GetClusterResources(ctx context.Context, cfg *rest.Config, filterFuncs ...FilterResource) (UnstructuredResources, error)
Use to get all CRUD'able resources for a cluster Returns a list of UnstructuredResources which are a wrapper for the map[string]interface{} type created from Kubernetes-style JSON objects.
Warning: slow function, be sure to call asynchronously. Filter funcs can be passed to reduce the latency of this function, i.e.: by excluding resource types (each resource type gets its own query, contributing to latency of this function).
func (UnstructuredResources) ByKey ¶
func (urs UnstructuredResources) ByKey() UnstructuredResourcesByKey
func (UnstructuredResources) Filter ¶
func (urs UnstructuredResources) Filter(filter func(resource *unstructured.Unstructured) bool) UnstructuredResources
func (UnstructuredResources) GroupedByGVK ¶
func (urs UnstructuredResources) GroupedByGVK() []VersionedResources
func (UnstructuredResources) Sort ¶
func (urs UnstructuredResources) Sort() UnstructuredResources
func (UnstructuredResources) WithLabels ¶
func (urs UnstructuredResources) WithLabels(targetLabels map[string]string) UnstructuredResources
type UnstructuredResourcesByKey ¶
type UnstructuredResourcesByKey map[ResourceKey]*unstructured.Unstructured
func (UnstructuredResourcesByKey) List ¶
func (urs UnstructuredResourcesByKey) List() UnstructuredResources
type VersionedResources ¶
type VersionedResources struct { GVK schema.GroupVersionKind Resources UnstructuredResources }