Documentation ¶
Index ¶
- Constants
- func ApplyManifests(ctx context.Context, opts ManifestApplierOptions) (managedresource.ManagedResourceStatusList, error)
- func DeleteManagedResources(ctx context.Context, ...) 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
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 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, managedResources managedresource.ManagedResourceStatusList, groupDefinitions []managedresource.DeletionGroupDefinition, targetClient client.Client, deployItem *lsv1alpha1.DeployItem, interruptionChecker interruption.InterruptionChecker, ) 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( definition managedresource.DeletionGroupDefinition, deployItem *lsv1alpha1.DeployItem, targetClient client.Client, interruptionChecker interruption.InterruptionChecker, ) (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 DeployItem *lsv1alpha1.DeployItem }
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"` }
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) 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.
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 }
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