Documentation
¶
Index ¶
- Constants
- type ResourceState
- type State
- func (s *State) AddManagedResource(res resource.Resource)
- func (s *State) GetRemovedResources(activeResources []resource.Resource) []resource.Resource
- func (s *State) IdentifyBy(identity func(kind string) []string)
- func (s *State) IsResourceManaged(ressource resource.Resource) bool
- func (s *State) RemoveManagedResource(res resource.Resource)
- func (s *State) RemoveManagedResourceKindName(kind schema.Kind, name string)
- func (s *State) RemoveManagedResourceVKM(apiVersion, kind string, metadata *map[string]any)
Constants ¶
View Source
const StateFileVersion = "v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceState ¶
type ResourceState struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata *map[string]any `json:"metadata"`
}
func NewResourceState ¶
func NewResourceState(res resource.Resource) ResourceState
func (*ResourceState) Equal ¶
func (r *ResourceState) Equal(other *ResourceState) bool
func (*ResourceState) SameIdentity ¶ added in v0.9.3
func (r *ResourceState) SameIdentity(other *ResourceState, keys []string) bool
SameIdentity compares only the kind and the given metadata keys: the same resource, whatever else has changed.
func (*ResourceState) ToResource ¶
func (r *ResourceState) ToResource() resource.Resource
type State ¶
type State struct {
Version string `json:"version"`
LastUpdated string `json:"lastUpdated"`
Resources []ResourceState `json:"resources"`
// contains filtered or unexported fields
}
func (*State) AddManagedResource ¶
func (*State) GetRemovedResources ¶
func (*State) IdentifyBy ¶ added in v0.9.3
IdentifyBy tells resources apart by the given metadata keys of their kind (see schema.Catalog.StateIdentity) instead of by all their metadata, so changing a description or labels does not make a resource look removed.
func (*State) IsResourceManaged ¶
func (*State) RemoveManagedResource ¶
func (*State) RemoveManagedResourceKindName ¶
Click to show internal directories.
Click to hide internal directories.