Documentation
¶
Index ¶
- Constants
- Variables
- func GetLabelsAndAnnotations(setID string, owner runtime.Object) (map[string]string, map[string]string, error)
- func GetSelector(labelSet map[string]string) (labels.Selector, error)
- func GetSelectorFromOwner(setID string, owner runtime.Object) (labels.Selector, error)
- type Apply
- type ClientFactory
- type InformerFactory
- type InformerGetter
- type PatchByGVK
- type Patcher
- type Plan
- type Reconciler
Constants ¶
View Source
const (
LabelID = "objectset.rio.cattle.io/id"
LabelGVK = "objectset.rio.cattle.io/owner-gvk"
LabelName = "objectset.rio.cattle.io/owner-name"
LabelNamespace = "objectset.rio.cattle.io/owner-namespace"
LabelHash = "objectset.rio.cattle.io/hash"
LabelPrefix = "objectset.rio.cattle.io/"
LabelPrune = "objectset.rio.cattle.io/prune"
)
View Source
const (
LabelApplied = "objectset.rio.cattle.io/applied"
)
Variables ¶
View Source
var (
ErrOwnerNotFound = errors.New("owner not found")
ErrNoInformerFound = errors.New("informer not found")
)
View Source
var (
ErrReplace = errors.New("replace object with changes")
ReplaceOnChange = func(name string, o runtime.Object, patchType types2.PatchType, data []byte, subresources ...string) (runtime.Object, error) {
return nil, ErrReplace
}
)
Functions ¶
func GetLabelsAndAnnotations ¶
func GetLabelsAndAnnotations(setID string, owner runtime.Object) (map[string]string, map[string]string, error)
func GetSelector ¶
func GetSelector(labelSet map[string]string) (labels.Selector, error)
func GetSelectorFromOwner ¶
func GetSelectorFromOwner(setID string, owner runtime.Object) (labels.Selector, error)
GetSelectorFromOwner returns the label selector for the owner object which is useful to list the dependents
Types ¶
type Apply ¶
type Apply interface {
Apply(set *objectset.ObjectSet) error
ApplyObjects(objs ...runtime.Object) error
WithContext(ctx context.Context) Apply
WithCacheTypes(igs ...InformerGetter) Apply
WithCacheTypeFactory(factory InformerFactory) Apply
WithSetID(id string) Apply
WithOwner(obj runtime.Object) Apply
WithOwnerKey(key string, gvk schema.GroupVersionKind) Apply
WithInjector(injs ...injectors.ConfigInjector) Apply
WithInjectorName(injs ...string) Apply
WithPatcher(gvk schema.GroupVersionKind, patchers Patcher) Apply
WithReconciler(gvk schema.GroupVersionKind, reconciler Reconciler) Apply
WithStrictCaching() Apply
WithDynamicLookup() Apply
WithRestrictClusterScoped() Apply
WithDefaultNamespace(ns string) Apply
WithListerNamespace(ns string) Apply
WithRateLimiting(ratelimitingQps float32) Apply
WithNoDelete() Apply
WithNoDeleteGVK(gvks ...schema.GroupVersionKind) Apply
WithGVK(gvks ...schema.GroupVersionKind) Apply
WithSetOwnerReference(controller, block bool) Apply
WithIgnorePreviousApplied() Apply
WithDiffPatch(gvk schema.GroupVersionKind, namespace, name string, patch []byte) Apply
FindOwner(obj runtime.Object) (runtime.Object, error)
PurgeOrphan(obj runtime.Object) error
DryRun(objs ...runtime.Object) (Plan, error)
}
func New ¶
func New(discovery discovery.DiscoveryInterface, cf ClientFactory, igs ...InformerGetter) Apply
func NewForConfig ¶
func NewForConfig(cfg *rest.Config) (Apply, error)
type ClientFactory ¶
type ClientFactory func(gvr schema.GroupVersionResource) (dynamic.NamespaceableResourceInterface, error)
func NewClientFactory ¶
func NewClientFactory(config *rest.Config) ClientFactory
type InformerFactory ¶
type InformerFactory interface {
Get(gvk schema.GroupVersionKind, gvr schema.GroupVersionResource) (cache.SharedIndexInformer, error)
}
type InformerGetter ¶
type InformerGetter interface {
Informer() cache.SharedIndexInformer
GroupVersionKind() schema.GroupVersionKind
}
type PatchByGVK ¶
type PatchByGVK map[schema.GroupVersionKind]map[objectset.ObjectKey]string
type Patcher ¶
type Patcher func(namespace, name string, pt types.PatchType, data []byte) (runtime.Object, error)
type Plan ¶
type Plan struct {
Create objectset.ObjectKeyByGVK
Delete objectset.ObjectKeyByGVK
Update PatchByGVK
Objects []runtime.Object
}
type Reconciler ¶
type Reconciler func(oldObj runtime.Object, newObj runtime.Object) (bool, error)
Reconciler return false if it did not handle this object
Source Files
¶
Click to show internal directories.
Click to hide internal directories.