resourcemanager

package
v0.107.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeoutCheckpointDeployerCleanupOrphaned                 = "deployer: cleanup orphaned"
	TimeoutCheckpointDeployerProcessManagedResourceManifests = "deployer: process managed resource manifests"
	TimeoutCheckpointDeployerProcessManifests                = "deployer: process manifests"
	TimeoutCheckpointDeployerApplyManifests                  = "deployer: apply manifests"
)
View Source
const (
	ExecutionGroupCRD = iota
	ExecutionGroupClusterwide
	ExecutionGroupNamespaced
)
View Source
const TimeoutCheckpointDeployerDeleteResources = "deployer: delete resources"

Variables

This section is empty.

Functions

func ApplyManifests

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

type ClusterScopedMatcher

type ClusterScopedMatcher struct{}

func (*ClusterScopedMatcher) Match

type CustomMatcher

type CustomMatcher struct {
	// contains filtered or unexported fields
}

func (*CustomMatcher) Match

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 (*DeletionGroup) Delete

func (g *DeletionGroup) Delete(ctx context.Context) (err error)

func (*DeletionGroup) GetAllResources

func (*DeletionGroup) GetManagedResources

func (g *DeletionGroup) GetManagedResources() []*managedresource.ManagedResourceStatus

func (*DeletionGroup) Match

type EmptyMatcher

type EmptyMatcher struct{}

func (*EmptyMatcher) Match

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.

func (*Exporter) Export

func (e *Exporter) Export(ctx context.Context, exports *managedresource.Exports) (map[string]interface{}, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL