Documentation ¶
Index ¶
- Constants
- func AnnotateAndPatchBeforeDelete(ctx context.Context, mr *managedresource.ManagedResourceStatus, ...) (notFound bool, err error)
- func ApplyManifests(ctx context.Context, opts ManifestApplierOptions) (managedresource.ManagedResourceStatusList, error)
- func DeleteManagedResources(ctx context.Context, lsUncachedClient client.Client, ...) error
- func FilterByPolicy(ctx context.Context, mr *managedresource.ManagedResourceStatus, ...) (bool, error)
- type ApiResourceHandler
- type CRDMatcher
- type ClusterScopedMatcher
- type CustomMatcher
- type DeletionGroup
- func (g *DeletionGroup) AddResource(res *managedresource.ManagedResourceStatus)
- func (g *DeletionGroup) Delete(ctx context.Context) (err error)
- func (g *DeletionGroup) GetAllResources(ctx context.Context) ([]*managedresource.ManagedResourceStatus, error)
- func (g *DeletionGroup) GetManagedResources() []*managedresource.ManagedResourceStatus
- func (g *DeletionGroup) Match(res *managedresource.ManagedResourceStatus) bool
- type EmptyMatcher
- type Exporter
- type ExporterOptions
- type Manifest
- type ManifestApplier
- type ManifestApplierOptions
- type Matcher
- type NamespacedMatcher
- type PatchInfo
Constants ¶
const ( TimeoutCheckpointDeployerCleanupOrphaned = "deployer: cleanup orphaned" TimeoutCheckpointDeployerProcessManagedResourceManifests = "deployer: process managed resource manifests" TimeoutCheckpointDeployerProcessManifests = "deployer: process manifests" TimeoutCheckpointDeployerApplyManifests = "deployer: apply manifests" )
const ( ExecutionGroupCRD = iota ExecutionGroupClusterwide ExecutionGroupNamespaced )
const TimeoutCheckpointDeployerDeleteResources = "deployer: delete resources"
Variables ¶
This section is empty.
Functions ¶
func AnnotateAndPatchBeforeDelete ¶ added in v0.110.0
func AnnotateAndPatchBeforeDelete(ctx context.Context, mr *managedresource.ManagedResourceStatus, targetClient client.Client) (notFound bool, err error)
func ApplyManifests ¶
func ApplyManifests(ctx context.Context, opts ManifestApplierOptions) (managedresource.ManagedResourceStatusList, error)
ApplyManifests creates or updates all configured manifests.
func DeleteManagedResources ¶
func DeleteManagedResources( ctx context.Context, lsUncachedClient client.Client, managedResources managedresource.ManagedResourceStatusList, groupDefinitions []managedresource.DeletionGroupDefinition, targetClient client.Client, deployItem *lsv1alpha1.DeployItem, interruptionChecker interruption.InterruptionChecker, lsRestConfig *rest.Config, ) error
func FilterByPolicy ¶
func FilterByPolicy(ctx context.Context, mr *managedresource.ManagedResourceStatus, targetClient client.Client, deployItemName string) (bool, error)
FilterByPolicy is used during the deletion of manifest deployitems and manifest-only helm deployitems. It returns true if the deployitem can be deleted according to its policy, and false if it must not be deleted.
Types ¶
type ApiResourceHandler ¶
type ApiResourceHandler struct {
// contains filtered or unexported fields
}
func CreateApiResourceHandler ¶
func CreateApiResourceHandler(clientset kubernetes.Interface) *ApiResourceHandler
func (*ApiResourceHandler) GetApiResource ¶
func (a *ApiResourceHandler) GetApiResource(manifest *Manifest) (metav1.APIResource, error)
func (*ApiResourceHandler) GetApiResourceForType ¶
func (a *ApiResourceHandler) GetApiResourceForType(typeMeta metav1.TypeMeta) (metav1.APIResource, error)
type CRDMatcher ¶
type CRDMatcher struct{}
func (*CRDMatcher) Match ¶
func (m *CRDMatcher) Match(res *managedresource.ManagedResourceStatus) bool
type ClusterScopedMatcher ¶
type ClusterScopedMatcher struct{}
func (*ClusterScopedMatcher) Match ¶
func (m *ClusterScopedMatcher) Match(res *managedresource.ManagedResourceStatus) bool
type CustomMatcher ¶
type CustomMatcher struct {
// contains filtered or unexported fields
}
func (*CustomMatcher) Match ¶
func (m *CustomMatcher) Match(res *managedresource.ManagedResourceStatus) bool
type DeletionGroup ¶
type DeletionGroup struct {
// contains filtered or unexported fields
}
func NewDeletionGroup ¶
func NewDeletionGroup( ctx context.Context, lsUncachedClient client.Client, definition managedresource.DeletionGroupDefinition, deployItem *lsv1alpha1.DeployItem, primaryTargetClient client.Client, interruptionChecker interruption.InterruptionChecker, lsRestConfig *rest.Config, ) (group *DeletionGroup, err error)
func (*DeletionGroup) AddResource ¶
func (g *DeletionGroup) AddResource(res *managedresource.ManagedResourceStatus)
func (*DeletionGroup) GetAllResources ¶
func (g *DeletionGroup) GetAllResources(ctx context.Context) ([]*managedresource.ManagedResourceStatus, error)
func (*DeletionGroup) GetManagedResources ¶
func (g *DeletionGroup) GetManagedResources() []*managedresource.ManagedResourceStatus
func (*DeletionGroup) Match ¶
func (g *DeletionGroup) Match(res *managedresource.ManagedResourceStatus) bool
type EmptyMatcher ¶
type EmptyMatcher struct{}
func (*EmptyMatcher) Match ¶
func (m *EmptyMatcher) Match(*managedresource.ManagedResourceStatus) bool
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter defines the export of data from manifests.
func NewExporter ¶
func NewExporter(opts ExporterOptions) *Exporter
NewExporter creates a new exporter.
type ExporterOptions ¶
type ExporterOptions struct { KubeClient client.Client InterruptionChecker interruption.InterruptionChecker LsClient client.Client DeployItem *lsv1alpha1.DeployItem LsRestConfig *rest.Config }
ExporterOptions defines the options for the exporter.
type Manifest ¶
type Manifest struct { TypeMeta metav1.TypeMeta // Policy defines the manage policy for that resource. Policy managedresource.ManifestPolicy `json:"policy,omitempty"` // Manifest defines the raw k8s manifest. Manifest *runtime.RawExtension `json:"manifest,omitempty"` // AnnotateBeforeCreate defines annotations that are being set before the manifest is being created. AnnotateBeforeCreate map[string]string `json:"annotateBeforeCreate,omitempty"` // AnnotateBeforeDelete defines annotations that are being set before the manifest is being deleted. AnnotateBeforeDelete map[string]string `json:"annotateBeforeDelete,omitempty"` // PatchAfterDeployment defines a patch that is being applied after an object has been deployed. PatchAfterDeployment *runtime.RawExtension `json:"patchAfterDeployment,omitempty"` // PatchBeforeDelete defines a patch that is being applied before an object is being deleted. PatchBeforeDelete *runtime.RawExtension `json:"patchBeforeDelete,omitempty"` }
Manifest is the internal representation of a manifest
type ManifestApplier ¶
type ManifestApplier struct {
// contains filtered or unexported fields
}
ManifestApplier creates or updated manifest based on their definition.
func NewManifestApplier ¶
func NewManifestApplier(opts ManifestApplierOptions) *ManifestApplier
NewManifestApplier creates a new manifest deployer
func (*ManifestApplier) Apply ¶
func (a *ManifestApplier) Apply(ctx context.Context) ([]*PatchInfo, error)
Apply creates or updates all configured manifests.
func (*ManifestApplier) GetManagedResourcesStatus ¶
func (a *ManifestApplier) GetManagedResourcesStatus() managedresource.ManagedResourceStatusList
GetManagedResourcesStatus returns the managed resources of the applier.
func (*ManifestApplier) PatchAfterDeployment ¶ added in v0.110.0
func (a *ManifestApplier) PatchAfterDeployment(ctx context.Context, patchInfos []*PatchInfo) error
type ManifestApplierOptions ¶
type ManifestApplierOptions struct { Decoder runtime.Decoder KubeClient client.Client Clientset kubernetes.Interface DefaultNamespace string DeployItemName string DeployItem *lsv1alpha1.DeployItem UpdateStrategy manifestv1alpha2.UpdateStrategy Manifests []managedresource.Manifest ManagedResources managedresource.ManagedResourceStatusList // Labels defines additional labels that are automatically injected into all resources. Labels map[string]string DeletionGroupsDuringUpdate []managedresource.DeletionGroupDefinition InterruptionChecker interruption.InterruptionChecker LsUncachedClient client.Client LsRestConfig *rest.Config }
ManifestApplierOptions describes options for the manifest applier
type Matcher ¶
type Matcher interface {
Match(*managedresource.ManagedResourceStatus) bool
}
type NamespacedMatcher ¶
type NamespacedMatcher struct{}
func (*NamespacedMatcher) Match ¶
func (m *NamespacedMatcher) Match(res *managedresource.ManagedResourceStatus) bool
type PatchInfo ¶ added in v0.110.0
type PatchInfo struct { Resource *unstructured.Unstructured Patch *runtime.RawExtension }