Documentation
¶
Index ¶
- type APIGroupKindMatcher
- type APIVersionKindMatcher
- type AllAndMatchingOpts
- type AllResourceMatcher
- type AnyMatcher
- type AnyResourceMatcher
- type AssociationLabel
- type BoolFilter
- type BytesSource
- 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, opts AllAndMatchingOpts) ([]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) AsCompactBytes() ([]byte, error)
- func (r *ResourceImpl) AsTypedObj(obj interface{}) error
- func (r *ResourceImpl) AsUncheckedTypedObj(obj interface{}) error
- func (r *ResourceImpl) AsYAMLBytes() ([]byte, error)
- func (r *ResourceImpl) CreatedAt() time.Time
- func (r *ResourceImpl) Debug(title string)
- 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) MarkTransient(transient bool)
- func (r *ResourceImpl) Name() string
- func (r *ResourceImpl) Namespace() string
- func (r *ResourceImpl) Origin() 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) SetOrigin(origin string)
- func (r *ResourceImpl) Status() map[string]interface{}
- func (r *ResourceImpl) Transient() bool
- func (r *ResourceImpl) UID() string
- type ResourceMatcher
- type ResourceMod
- type ResourceModWithMultiple
- type ResourceRef
- type ResourceType
- type ResourceTypes
- type ResourceTypesImpl
- type ResourceTypesImplOpts
- 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 ¶
type APIGroupKindMatcher struct {
APIGroup string
Kind string
}
type APIVersionKindMatcher ¶
type APIVersionKindMatcher struct {
APIVersion string
Kind string
}
type AllAndMatchingOpts ¶ added in v0.8.0
type AllAndMatchingOpts struct {
SkipResourceOwnershipCheck bool
BlacklistedResourcesByLabelKeys []string
}
type AllResourceMatcher ¶
type AllResourceMatcher struct{}
type AnyMatcher ¶
type AnyMatcher struct {
Matchers []ResourceMatcher
}
type AnyResourceMatcher ¶
type AnyResourceMatcher struct {
Matchers []ResourceMatcher
}
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
type BoolFilter ¶
type BoolFilter struct {
And []BoolFilter
Or []BoolFilter
Not *BoolFilter
Resource *ResourceFilter
}
func NewBoolFilterFromString ¶
func NewBoolFilterFromString(data string) (*BoolFilter, error)
type BytesSource ¶ added in v0.10.0
type BytesSource struct {
// contains filtered or unexported fields
}
func NewBytesSource ¶ added in v0.10.0
func NewBytesSource(bytes []byte) BytesSource
func (BytesSource) Description ¶ added in v0.10.0
func (s BytesSource) Description() string
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) ApplyFromMultiple ¶ added in v0.6.0
func (t FieldRemoveMod) ApplyFromMultiple(res Resource, _ map[FieldCopyModSource]Resource) error
type FileResource ¶
type FileResource struct {
// contains filtered or unexported fields
}
func NewFileResource ¶ added in v0.10.0
func NewFileResource(fileSrc FileSource) FileResource
func NewFileResources ¶
func NewFileResources(file string) ([]FileResource, error)
func (FileResource) Description ¶
func (r FileResource) Description() string
type FileSource ¶
type FileSource interface {
Description() string
Bytes() ([]byte, error)
}
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) 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, resourceTypes ResourceTypes,
fallbackAllowedNamespaces []string, logger logger.Logger) IdentifiedResources
func (IdentifiedResources) ConfigMapResources ¶
func (r IdentifiedResources) ConfigMapResources(labelSelector labels.Selector) ([]corev1.ConfigMap, error)
func (IdentifiedResources) Create ¶
func (r IdentifiedResources) Create(resource 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) Patch ¶
func (r IdentifiedResources) Patch(resource Resource, patchType types.PatchType, data []byte) (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) MatchesVersion ¶
func (a IdentityAnnotation) MatchesVersion() bool
MatchesVersion returns true if annotation is valid and it matches version
type KindNamespaceNameMatcher ¶
type KindNamespaceNameMatcher struct {
Kind, Namespace, Name string
}
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, logger logger.Logger) *LabeledResources
func (*LabeledResources) AllAndMatching ¶
func (a *LabeledResources) AllAndMatching(newResources []Resource, opts AllAndMatchingOpts) ([]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)
type LocalFileSource ¶
type LocalFileSource struct {
// contains filtered or unexported fields
}
func NewLocalFileSource ¶
func NewLocalFileSource(path string) LocalFileSource
func (LocalFileSource) Description ¶
func (s LocalFileSource) Description() string
type ObjectRefSetMod ¶
type ObjectRefSetMod struct {
ResourceMatcher ResourceMatcher
Path Path
ReplacementFunc func(map[string]interface{}) error
}
type OwnershipLabelModsFunc ¶
type OwnershipLabelModsFunc func(kvs map[string]string) []StringMapAppendMod
type PartialResourceRef ¶
type PartialResourceRef struct {
schema.GroupVersionResource
}
type Path ¶
type Path []*PathPart
func NewPathFromInterfaces ¶
func NewPathFromInterfaces(parts []interface{}) Path
func NewPathFromStrings ¶
func NewPathFromStrings(strs []string) Path
func (Path) ContainsNonMapKeys ¶
func (p Path) ContainsNonMapKeys() bool
type PathPart ¶
type PathPart struct {
MapKey *string
ArrayIndex *PathPartArrayIndex
}
func NewPathPartFromIndex ¶
func NewPathPartFromIndex(i int) *PathPart
func NewPathPartFromIndexAll ¶
func NewPathPartFromIndexAll() *PathPart
func NewPathPartFromString ¶
func NewPathPartFromString(str string) *PathPart
func (*PathPart) UnmarshalJSON ¶
func (p *PathPart) UnmarshalJSON(data []byte) error
type PathPartArrayIndex ¶
type PathPartArrayIndex struct {
Index *int
All *bool `json:"allIndexes"`
}
type PodWatcher ¶
type PodWatcher struct {
// contains filtered or unexported fields
}
func NewPodWatcher ¶
func NewPodWatcher(
podsClient typedcorev1.PodInterface,
listOpts metav1.ListOptions,
) PodWatcher
type PodWatcherI ¶
type PodWatcherI interface {
Watch(podsToWatchCh chan corev1.Pod, cancelCh chan struct{}) error
}
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)
AsCompactBytes() ([]byte, error)
AsTypedObj(obj interface{}) error
AsUncheckedTypedObj(obj interface{}) error
Debug(string)
SetOrigin(string)
Origin() string
MarkTransient(bool)
Transient() bool
// contains filtered or unexported methods
}
func NewResourcesFromBytes ¶
func NewResourcesFromBytes(data []byte) ([]Resource, error)
type ResourceFilter ¶
type ResourceFilter struct {
CreatedAtBeforeTime *time.Time
CreatedAtAfterTime *time.Time
Kinds []string
Namespaces []string
Names []string
KindNames []string
KindNamespaces []string
KindNsNames []string
BoolFilter *BoolFilter
}
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, resType ResourceType) *ResourceImpl
func (*ResourceImpl) APIVersion ¶
func (r *ResourceImpl) APIVersion() string
func (*ResourceImpl) Annotations ¶
func (r *ResourceImpl) Annotations() map[string]string
func (*ResourceImpl) AsCompactBytes ¶ added in v0.15.0
func (r *ResourceImpl) AsCompactBytes() ([]byte, error)
func (*ResourceImpl) AsTypedObj ¶
func (r *ResourceImpl) AsTypedObj(obj interface{}) error
func (*ResourceImpl) AsUncheckedTypedObj ¶ added in v0.10.0
func (r *ResourceImpl) AsUncheckedTypedObj(obj interface{}) error
func (*ResourceImpl) AsYAMLBytes ¶
func (r *ResourceImpl) AsYAMLBytes() ([]byte, error)
func (*ResourceImpl) DeepCopyRaw ¶
func (r *ResourceImpl) DeepCopyRaw() map[string]interface{}
func (*ResourceImpl) Description ¶
func (r *ResourceImpl) Description() string
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) MarkTransient ¶ added in v0.12.0
func (r *ResourceImpl) MarkTransient(transient bool)
func (*ResourceImpl) RemoveNamespace ¶ added in v0.2.0
func (r *ResourceImpl) RemoveNamespace()
func (*ResourceImpl) SetNamespace ¶
func (r *ResourceImpl) SetNamespace(name string)
type ResourceMatcher ¶
type ResourceMatcher interface {
Matches(Resource) bool
}
type ResourceMod ¶
type ResourceMod interface {
Apply(Resource) error
}
type ResourceModWithMultiple ¶ added in v0.6.0
type ResourceModWithMultiple interface {
ApplyFromMultiple(Resource, map[FieldCopyModSource]Resource) error
}
type ResourceRef ¶
type ResourceRef struct {
schema.GroupVersionResource
}
type ResourceType ¶
type ResourceType struct {
schema.GroupVersionResource
metav1.APIResource
}
func NonMatching ¶
func NonMatching(in []ResourceType, ref ResourceRef) []ResourceType
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, opts ResourceTypesImplOpts) *ResourceTypesImpl
type ResourceTypesImplOpts ¶ added in v0.15.0
type ResourceTypesImplOpts struct {
IgnoreFailingAPIServices bool
}
type ResourceTypesUnknownTypeErr ¶
type ResourceTypesUnknownTypeErr struct {
// contains filtered or unexported fields
}
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
func NewResources ¶
func NewResources(resourceTypes ResourceTypes, coreClient kubernetes.Interface,
dynamicClient dynamic.Interface, fallbackAllowedNamespaces []string, logger logger.Logger) *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) 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
}
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
type UniqueResources ¶
type UniqueResources struct {
// contains filtered or unexported fields
}
func NewUniqueResources ¶
func NewUniqueResources(resources []Resource) UniqueResources
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.