Documentation
¶
Index ¶
- type APIGroupKindMatcher
- type APIVersionKindMatcher
- type AllResourceMatcher
- type AnyMatcher
- type AnyResourceMatcher
- type AssociationLabel
- type BoolFilter
- type FieldCopyMod
- type FieldCopyModSource
- type FieldRemoveMod
- type FileResource
- type FileSource
- type FilteringPodWatcher
- type HTTPFileSource
- type IdentifiedResources
- func (r IdentifiedResources) ConfigMapResources(labelSelector labels.Selector) ([]corev1.ConfigMap, error)
- func (r IdentifiedResources) Create(resource Resource) (Resource, error)
- func (r IdentifiedResources) Delete(resource Resource) error
- func (r IdentifiedResources) Exists(resource Resource) (bool, error)
- func (r IdentifiedResources) Get(resource Resource) (Resource, error)
- func (r IdentifiedResources) List(labelSelector labels.Selector) ([]Resource, error)
- func (r IdentifiedResources) Patch(resource Resource, patchType types.PatchType, data []byte) (Resource, error)
- func (r IdentifiedResources) PodResources(labelSelector labels.Selector) UniquePodWatcher
- func (r IdentifiedResources) Update(resource Resource) (Resource, error)
- type IdentityAnnotation
- type KindNamespaceNameMatcher
- type LabelScopingModsFunc
- type LabeledResources
- func (a *LabeledResources) All() ([]Resource, error)
- func (a *LabeledResources) AllAndMatching(newResources []Resource) ([]Resource, error)
- func (a *LabeledResources) GetAssociated(resource Resource) ([]Resource, error)
- func (a *LabeledResources) Prepare(resources []Resource, olmFunc OwnershipLabelModsFunc, ...) error
- type LocalFileSource
- type ObjectRefSetMod
- type OwnershipLabelModsFunc
- type PartialResourceRef
- type Path
- type PathPart
- type PathPartArrayIndex
- type PodWatcher
- type PodWatcherI
- type Resource
- type ResourceFilter
- type ResourceImpl
- func (r *ResourceImpl) APIGroup() string
- func (r *ResourceImpl) APIVersion() string
- func (r *ResourceImpl) Annotations() map[string]string
- func (r *ResourceImpl) AsTypedObj(obj interface{}) error
- func (r *ResourceImpl) AsYAMLBytes() ([]byte, error)
- func (r *ResourceImpl) CreatedAt() time.Time
- func (r *ResourceImpl) DeepCopy() Resource
- func (r *ResourceImpl) DeepCopyRaw() map[string]interface{}
- func (r *ResourceImpl) Description() string
- func (r *ResourceImpl) Equal(res Resource) bool
- func (r *ResourceImpl) GroupVersionResource() schema.GroupVersionResource
- func (r *ResourceImpl) IsDeleting() bool
- func (r *ResourceImpl) IsProvisioned() bool
- func (r *ResourceImpl) Kind() string
- func (r *ResourceImpl) Labels() map[string]string
- func (r *ResourceImpl) Name() string
- func (r *ResourceImpl) Namespace() string
- func (r *ResourceImpl) OwnerRefs() []metav1.OwnerReference
- func (r *ResourceImpl) RemoveNamespace()
- func (r *ResourceImpl) SetName(name string)
- func (r *ResourceImpl) SetNamespace(name string)
- func (r *ResourceImpl) Status() map[string]interface{}
- func (r *ResourceImpl) Transient() bool
- func (r *ResourceImpl) UID() string
- type ResourceMatcher
- type ResourceMod
- type ResourceRef
- type ResourceType
- type ResourceTypes
- type ResourceTypesImpl
- type ResourceTypesUnknownTypeErr
- type Resources
- func (c Resources) All(resTypes []ResourceType, opts ResourcesAllOpts) ([]Resource, error)
- func (c Resources) Create(resource Resource) (Resource, error)
- func (c Resources) Delete(resource Resource) error
- func (c Resources) Exists(resource Resource) (bool, error)
- func (c Resources) Get(resource Resource) (Resource, error)
- func (c Resources) Patch(resource Resource, patchType types.PatchType, data []byte) (Resource, error)
- func (c Resources) Update(resource Resource) (Resource, error)
- type ResourcesAllOpts
- type SimpleLabel
- type StdinSource
- type StringMapAppendMod
- type UniquePodWatcher
- type UniqueResourceKey
- type UniqueResources
- type YAMLFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIGroupKindMatcher ¶
func (APIGroupKindMatcher) Matches ¶
func (m APIGroupKindMatcher) Matches(res Resource) bool
type APIVersionKindMatcher ¶
func (APIVersionKindMatcher) Matches ¶
func (m APIVersionKindMatcher) Matches(res Resource) bool
type AllResourceMatcher ¶
type AllResourceMatcher struct{}
func (AllResourceMatcher) Matches ¶
func (AllResourceMatcher) Matches(Resource) bool
type AnyMatcher ¶
type AnyMatcher struct {
Matchers []ResourceMatcher
}
func (AnyMatcher) Matches ¶
func (m AnyMatcher) Matches(res Resource) bool
type AnyResourceMatcher ¶
type AnyResourceMatcher struct {
Matchers []ResourceMatcher
}
func (AnyResourceMatcher) Matches ¶
func (m AnyResourceMatcher) Matches(res Resource) bool
type AssociationLabel ¶
type AssociationLabel struct {
// contains filtered or unexported fields
}
func NewAssociationLabel ¶
func NewAssociationLabel(resource Resource) AssociationLabel
func (AssociationLabel) AsSelector ¶
func (a AssociationLabel) AsSelector() labels.Selector
func (AssociationLabel) Key ¶
func (a AssociationLabel) Key() string
func (AssociationLabel) Value ¶
func (a AssociationLabel) Value() string
type BoolFilter ¶
type BoolFilter struct { And []BoolFilter Or []BoolFilter Not *BoolFilter Resource *ResourceFilter }
func NewBoolFilterFromString ¶
func NewBoolFilterFromString(data string) (*BoolFilter, error)
func (BoolFilter) Matches ¶
func (m BoolFilter) Matches(res Resource) bool
type FieldCopyMod ¶
type FieldCopyMod struct { ResourceMatcher ResourceMatcher Path Path Sources []FieldCopyModSource // first preferred }
func (FieldCopyMod) ApplyFromMultiple ¶
func (t FieldCopyMod) ApplyFromMultiple(res Resource, srcs map[FieldCopyModSource]Resource) error
type FieldCopyModSource ¶
type FieldCopyModSource string
const ( FieldCopyModSourceNew FieldCopyModSource = "new" FieldCopyModSourceExisting = "existing" )
type FieldRemoveMod ¶
type FieldRemoveMod struct { ResourceMatcher ResourceMatcher Path Path }
func (FieldRemoveMod) Apply ¶
func (t FieldRemoveMod) Apply(res Resource) error
type FileResource ¶
type FileResource struct {
// contains filtered or unexported fields
}
func NewFileResources ¶
func NewFileResources(file string, recursive bool) ([]FileResource, error)
func (FileResource) Description ¶
func (r FileResource) Description() string
func (FileResource) Resources ¶
func (r FileResource) Resources() ([]Resource, error)
type FileSource ¶
type FilteringPodWatcher ¶
type FilteringPodWatcher struct { MatcherFunc func(*corev1.Pod) bool Watcher PodWatcherI }
type HTTPFileSource ¶
type HTTPFileSource struct {
// contains filtered or unexported fields
}
func NewHTTPFileSource ¶
func NewHTTPFileSource(path string) HTTPFileSource
func (HTTPFileSource) Bytes ¶
func (s HTTPFileSource) Bytes() ([]byte, error)
func (HTTPFileSource) Description ¶
func (s HTTPFileSource) Description() string
type IdentifiedResources ¶
type IdentifiedResources struct {
// contains filtered or unexported fields
}
func NewIdentifiedResources ¶
func NewIdentifiedResources(coreClient kubernetes.Interface, dynamicClient dynamic.Interface) IdentifiedResources
func (IdentifiedResources) ConfigMapResources ¶
func (IdentifiedResources) Create ¶
func (r IdentifiedResources) Create(resource Resource) (Resource, error)
func (IdentifiedResources) Delete ¶
func (r IdentifiedResources) Delete(resource Resource) error
func (IdentifiedResources) Exists ¶
func (r IdentifiedResources) Exists(resource Resource) (bool, error)
func (IdentifiedResources) Get ¶
func (r IdentifiedResources) Get(resource Resource) (Resource, error)
func (IdentifiedResources) List ¶
func (r IdentifiedResources) List(labelSelector labels.Selector) ([]Resource, error)
func (IdentifiedResources) PodResources ¶
func (r IdentifiedResources) PodResources(labelSelector labels.Selector) UniquePodWatcher
type IdentityAnnotation ¶
type IdentityAnnotation struct {
// contains filtered or unexported fields
}
func NewIdentityAnnotation ¶
func NewIdentityAnnotation(resource Resource) IdentityAnnotation
func (IdentityAnnotation) AddMod ¶
func (a IdentityAnnotation) AddMod() StringMapAppendMod
func (IdentityAnnotation) MatchesVersion ¶
func (a IdentityAnnotation) MatchesVersion() bool
MatchesVersion returns true if annotation is valid and it matches version
func (IdentityAnnotation) RemoveMod ¶
func (a IdentityAnnotation) RemoveMod() FieldRemoveMod
func (IdentityAnnotation) Valid ¶
func (a IdentityAnnotation) Valid() bool
Valid returns true if signature matches resource itself
type KindNamespaceNameMatcher ¶
type KindNamespaceNameMatcher struct {
Kind, Namespace, Name string
}
func (KindNamespaceNameMatcher) Matches ¶
func (m KindNamespaceNameMatcher) Matches(res Resource) bool
type LabelScopingModsFunc ¶
type LabelScopingModsFunc func(kvs map[string]string) []StringMapAppendMod
type LabeledResources ¶
type LabeledResources struct {
// contains filtered or unexported fields
}
func NewLabeledResources ¶
func NewLabeledResources(labelSelector labels.Selector, identifiedResources IdentifiedResources) *LabeledResources
func (*LabeledResources) All ¶
func (a *LabeledResources) All() ([]Resource, error)
func (*LabeledResources) AllAndMatching ¶
func (a *LabeledResources) AllAndMatching(newResources []Resource) ([]Resource, error)
AllAndMatching returns set of all labeled resources plus resources that match newResources. Returns errors if non-labeled resources were labeled with a different value.
func (*LabeledResources) GetAssociated ¶
func (a *LabeledResources) GetAssociated(resource Resource) ([]Resource, error)
func (*LabeledResources) Prepare ¶
func (a *LabeledResources) Prepare(resources []Resource, olmFunc OwnershipLabelModsFunc, lsmFunc LabelScopingModsFunc) error
type LocalFileSource ¶
type LocalFileSource struct {
// contains filtered or unexported fields
}
func NewLocalFileSource ¶
func NewLocalFileSource(path string) LocalFileSource
func (LocalFileSource) Bytes ¶
func (s LocalFileSource) Bytes() ([]byte, error)
func (LocalFileSource) Description ¶
func (s LocalFileSource) Description() string
type ObjectRefSetMod ¶
type ObjectRefSetMod struct { ResourceMatcher ResourceMatcher Path Path ReplacementFunc func(map[string]interface{}) error }
func (ObjectRefSetMod) Apply ¶
func (t ObjectRefSetMod) Apply(res Resource) error
type OwnershipLabelModsFunc ¶
type OwnershipLabelModsFunc func(kvs map[string]string) []StringMapAppendMod
type PartialResourceRef ¶
type PartialResourceRef struct {
schema.GroupVersionResource
}
func (PartialResourceRef) Matches ¶
func (r PartialResourceRef) Matches(other schema.GroupVersionResource) bool
type Path ¶
type Path []*PathPart
func NewPathFromInterfaces ¶
func NewPathFromInterfaces(parts []interface{}) Path
func NewPathFromStrings ¶
func (Path) ContainsNonMapKeys ¶
type PathPart ¶
type PathPart struct { MapKey *string ArrayIndex *PathPartArrayIndex }
func NewPathPartFromIndex ¶
func NewPathPartFromIndexAll ¶
func NewPathPartFromIndexAll() *PathPart
func NewPathPartFromString ¶
func (*PathPart) UnmarshalJSON ¶
type PathPartArrayIndex ¶
type PodWatcher ¶
type PodWatcher struct {
// contains filtered or unexported fields
}
func NewPodWatcher ¶
func NewPodWatcher( podsClient typedcorev1.PodInterface, listOpts metav1.ListOptions, ) PodWatcher
type PodWatcherI ¶
type Resource ¶
type Resource interface { GroupVersionResource() schema.GroupVersionResource Kind() string APIVersion() string APIGroup() string Namespace() string SetNamespace(name string) RemoveNamespace() Name() string SetName(name string) Description() string Annotations() map[string]string Labels() map[string]string OwnerRefs() []metav1.OwnerReference Status() map[string]interface{} CreatedAt() time.Time IsProvisioned() bool IsDeleting() bool UID() string Equal(res Resource) bool DeepCopy() Resource DeepCopyRaw() map[string]interface{} AsYAMLBytes() ([]byte, error) AsTypedObj(obj interface{}) error Transient() bool // contains filtered or unexported methods }
func NewResourcesFromBytes ¶
type ResourceFilter ¶
type ResourceFilter struct { CreatedAtAfterTime *time.Time Kinds []string Namespaces []string Names []string KindNamespaces []string KindNsNames []string BoolFilter *BoolFilter }
func (ResourceFilter) Apply ¶
func (f ResourceFilter) Apply(resources []Resource) []Resource
func (ResourceFilter) Matches ¶
func (f ResourceFilter) Matches(resource Resource) bool
type ResourceImpl ¶
type ResourceImpl struct {
// contains filtered or unexported fields
}
func MustNewResourceFromBytes ¶
func MustNewResourceFromBytes(data []byte) *ResourceImpl
func NewResourceFromBytes ¶
func NewResourceFromBytes(data []byte) (*ResourceImpl, error)
func NewResourceUnstructured ¶
func NewResourceUnstructured(un unstructured.Unstructured, gvr schema.GroupVersionResource) *ResourceImpl
func (*ResourceImpl) APIGroup ¶
func (r *ResourceImpl) APIGroup() string
func (*ResourceImpl) APIVersion ¶
func (r *ResourceImpl) APIVersion() string
func (*ResourceImpl) Annotations ¶
func (r *ResourceImpl) Annotations() map[string]string
func (*ResourceImpl) AsTypedObj ¶
func (r *ResourceImpl) AsTypedObj(obj interface{}) error
func (*ResourceImpl) AsYAMLBytes ¶
func (r *ResourceImpl) AsYAMLBytes() ([]byte, error)
func (*ResourceImpl) CreatedAt ¶
func (r *ResourceImpl) CreatedAt() time.Time
func (*ResourceImpl) DeepCopy ¶
func (r *ResourceImpl) DeepCopy() Resource
func (*ResourceImpl) DeepCopyRaw ¶
func (r *ResourceImpl) DeepCopyRaw() map[string]interface{}
func (*ResourceImpl) Description ¶
func (r *ResourceImpl) Description() string
func (*ResourceImpl) Equal ¶
func (r *ResourceImpl) Equal(res Resource) bool
func (*ResourceImpl) GroupVersionResource ¶
func (r *ResourceImpl) GroupVersionResource() schema.GroupVersionResource
func (*ResourceImpl) IsDeleting ¶
func (r *ResourceImpl) IsDeleting() bool
func (*ResourceImpl) IsProvisioned ¶
func (r *ResourceImpl) IsProvisioned() bool
func (*ResourceImpl) Kind ¶
func (r *ResourceImpl) Kind() string
func (*ResourceImpl) Labels ¶
func (r *ResourceImpl) Labels() map[string]string
func (*ResourceImpl) Name ¶
func (r *ResourceImpl) Name() string
func (*ResourceImpl) Namespace ¶
func (r *ResourceImpl) Namespace() string
func (*ResourceImpl) OwnerRefs ¶
func (r *ResourceImpl) OwnerRefs() []metav1.OwnerReference
func (*ResourceImpl) RemoveNamespace ¶ added in v0.2.0
func (r *ResourceImpl) RemoveNamespace()
func (*ResourceImpl) SetName ¶
func (r *ResourceImpl) SetName(name string)
func (*ResourceImpl) SetNamespace ¶
func (r *ResourceImpl) SetNamespace(name string)
func (*ResourceImpl) Status ¶
func (r *ResourceImpl) Status() map[string]interface{}
func (*ResourceImpl) Transient ¶
func (r *ResourceImpl) Transient() bool
func (*ResourceImpl) UID ¶
func (r *ResourceImpl) UID() string
type ResourceMatcher ¶
type ResourceMod ¶
type ResourceRef ¶
type ResourceRef struct {
schema.GroupVersionResource
}
type ResourceType ¶
type ResourceType struct { schema.GroupVersionResource metav1.APIResource }
func Listable ¶
func Listable(in []ResourceType) []ResourceType
func Matching ¶
func Matching(in []ResourceType, ref ResourceRef) []ResourceType
func NonMatching ¶
func NonMatching(in []ResourceType, ref ResourceRef) []ResourceType
func (ResourceType) Deletable ¶
func (p ResourceType) Deletable() bool
func (ResourceType) Listable ¶
func (p ResourceType) Listable() bool
func (ResourceType) Namespaced ¶
func (p ResourceType) Namespaced() bool
type ResourceTypes ¶
type ResourceTypes interface { All() ([]ResourceType, error) Find(Resource) (ResourceType, error) }
type ResourceTypesImpl ¶
type ResourceTypesImpl struct {
// contains filtered or unexported fields
}
func NewResourceTypesImpl ¶
func NewResourceTypesImpl(coreClient kubernetes.Interface) *ResourceTypesImpl
func (*ResourceTypesImpl) All ¶
func (g *ResourceTypesImpl) All() ([]ResourceType, error)
func (*ResourceTypesImpl) Find ¶
func (g *ResourceTypesImpl) Find(resource Resource) (ResourceType, error)
type ResourceTypesUnknownTypeErr ¶
type ResourceTypesUnknownTypeErr struct {
// contains filtered or unexported fields
}
func (ResourceTypesUnknownTypeErr) Error ¶
func (e ResourceTypesUnknownTypeErr) Error() string
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
func NewResources ¶
func NewResources(resourceTypes ResourceTypes, coreClient kubernetes.Interface, dynamicClient dynamic.Interface) Resources
func (Resources) All ¶
func (c Resources) All(resTypes []ResourceType, opts ResourcesAllOpts) ([]Resource, error)
type ResourcesAllOpts ¶
type ResourcesAllOpts struct {
ListOpts *metav1.ListOptions
}
type SimpleLabel ¶
type SimpleLabel struct {
// contains filtered or unexported fields
}
func NewSimpleLabel ¶
func NewSimpleLabel(labelSelector labels.Selector) SimpleLabel
type StdinSource ¶
type StdinSource struct{}
func NewStdinSource ¶
func NewStdinSource() StdinSource
func (StdinSource) Bytes ¶
func (s StdinSource) Bytes() ([]byte, error)
func (StdinSource) Description ¶
func (s StdinSource) Description() string
type StringMapAppendMod ¶
type StringMapAppendMod struct { // For example applies to Deployment, ReplicaSet, StatefulSet // TODO should there be an opt-out way? ResourceMatcher ResourceMatcher Path Path SkipIfNotFound bool KVs map[string]string }
func (StringMapAppendMod) Apply ¶
func (t StringMapAppendMod) Apply(res Resource) error
type UniquePodWatcher ¶
type UniquePodWatcher struct {
// contains filtered or unexported fields
}
type UniqueResourceKey ¶
type UniqueResourceKey struct {
// contains filtered or unexported fields
}
func NewUniqueResourceKey ¶
func NewUniqueResourceKey(res Resource) UniqueResourceKey
func NewUniqueResourceKeyWithCustomName ¶
func NewUniqueResourceKeyWithCustomName(res Resource, name string) UniqueResourceKey
func (UniqueResourceKey) String ¶
func (k UniqueResourceKey) String() string
type UniqueResources ¶
type UniqueResources struct {
// contains filtered or unexported fields
}
func NewUniqueResources ¶
func NewUniqueResources(resources []Resource) UniqueResources
func (UniqueResources) Match ¶
func (r UniqueResources) Match(newResources []Resource) ([]Resource, error)
func (UniqueResources) Resources ¶
func (r UniqueResources) Resources() ([]Resource, error)
Source Files
¶
- association_label.go
- file_resources.go
- file_sources.go
- identified_resource_config_maps.go
- identified_resources.go
- identified_resources_list.go
- identified_resources_pods.go
- identity_annotation.go
- label.go
- labeled_resources.go
- matchers.go
- mod_field_copy.go
- mod_field_remove.go
- mod_object_ref_set.go
- mod_path.go
- mod_string_map_append.go
- pod_watcher.go
- refs.go
- resource.go
- resource_filter.go
- resource_types.go
- resources.go
- unique_resources.go
- yaml_doc.go
Click to show internal directories.
Click to hide internal directories.