Documentation
¶
Index ¶
- Constants
- Variables
- func BuildResourceInfos(ctx context.Context, deployType common.DeployType, ...) (instResourceInfos []*InstallableResourceInfo, ...)
- func ExecutePlan(parentCtx context.Context, releaseNamespace string, plan *Plan, ...) error
- func InstallableResourceInfoSortByMustInstallHandler(r1, r2 *InstallableResourceInfo) bool
- func InstallableResourceInfoSortByStageHandler(r1, r2 *InstallableResourceInfo) bool
- func OperationID(t OperationType, version OperationVersion, iteration OperationIteration, ...) string
- func OperationIDHuman(t OperationType, iteration OperationIteration, configIDHuman string) string
- func ResourceInstallTypeSortHandler(type1, type2 ResourceInstallType) bool
- func ValidateRemote(releaseName, releaseNamespace string, ...) error
- type BuildFailurePlanOptions
- type BuildPlanOptions
- type CalculatePlannedChangesOptions
- type DeletableResourceInfo
- type ExecutePlanOptions
- type InstallableResourceInfo
- type Operation
- type OperationCategory
- type OperationConfig
- type OperationConfigApply
- type OperationConfigCreate
- type OperationConfigCreateRelease
- type OperationConfigDelete
- type OperationConfigDeleteRelease
- type OperationConfigNoop
- type OperationConfigRecreate
- type OperationConfigTrackAbsence
- type OperationConfigTrackPresence
- type OperationConfigTrackReadiness
- type OperationConfigUpdate
- type OperationConfigUpdateRelease
- type OperationIteration
- type OperationStatus
- type OperationType
- type OperationVersion
- type Plan
- func (p *Plan) AddOperationChain() *planChainBuilder
- func (p *Plan) Connect(fromID, toID string) error
- func (p *Plan) Operation(id string) (op *Operation, found bool)
- func (p *Plan) Operations() []*Operation
- func (p *Plan) Optimize(noFinalTracking bool) error
- func (p *Plan) SquashOperation(op *Operation)
- func (p *Plan) ToDOT() ([]byte, error)
- type ReleaseInfo
- type ReleaseType
- type ResourceChange
- type ResourceInstallType
Constants ¶
View Source
const ( HiddenVerboseCRDChanges = "<hidden verbose CRD changes>" HiddenVerboseChanges = "<hidden verbose changes>" HiddenInsignificantChanges = "<hidden insignificant changes>" HiddenSensitiveChanges = "<hidden sensitive changes>" )
Variables ¶
View Source
var OrderedResourceInstallTypes = []ResourceInstallType{ ResourceInstallTypeNone, ResourceInstallTypeCreate, ResourceInstallTypeRecreate, ResourceInstallTypeUpdate, ResourceInstallTypeApply, }
Functions ¶
func BuildResourceInfos ¶ added in v1.13.0
func BuildResourceInfos(ctx context.Context, deployType common.DeployType, releaseName, releaseNamespace string, instResources []*resource.InstallableResource, delResources []*resource.DeletableResource, prevReleaseFailed, removeManualChanges bool, clientFactory kube.ClientFactorier, parallelism int) (instResourceInfos []*InstallableResourceInfo, delResourceInfos []*DeletableResourceInfo, err error)
func ExecutePlan ¶ added in v1.13.0
func ExecutePlan(parentCtx context.Context, releaseNamespace string, plan *Plan, taskStore *kdutil.Concurrent[*statestore.TaskStore], logStore *kdutil.Concurrent[*logstore.LogStore], informerFactory *kdutil.Concurrent[*informer.InformerFactory], history release.Historier, clientFactory kube.ClientFactorier, opts ExecutePlanOptions) error
func InstallableResourceInfoSortByMustInstallHandler ¶ added in v1.13.0
func InstallableResourceInfoSortByMustInstallHandler(r1, r2 *InstallableResourceInfo) bool
func InstallableResourceInfoSortByStageHandler ¶ added in v1.13.0
func InstallableResourceInfoSortByStageHandler(r1, r2 *InstallableResourceInfo) bool
func OperationID ¶ added in v1.13.0
func OperationID(t OperationType, version OperationVersion, iteration OperationIteration, configID string) string
func OperationIDHuman ¶ added in v1.13.0
func OperationIDHuman(t OperationType, iteration OperationIteration, configIDHuman string) string
func ResourceInstallTypeSortHandler ¶ added in v1.13.0
func ResourceInstallTypeSortHandler(type1, type2 ResourceInstallType) bool
func ValidateRemote ¶ added in v1.13.0
func ValidateRemote(releaseName, releaseNamespace string, installableResourceInfos []*InstallableResourceInfo, forceAdoption bool) error
Types ¶
type BuildFailurePlanOptions ¶ added in v1.14.0
type BuildFailurePlanOptions struct {
NoFinalTracking bool
}
type BuildPlanOptions ¶ added in v1.14.0
type BuildPlanOptions struct {
NoFinalTracking bool
}
type CalculatePlannedChangesOptions ¶ added in v1.13.0
type CalculatePlannedChangesOptions struct {
DiffContextLines int
ShowVerboseCRDDiffs bool
ShowVerboseDiffs bool
ShowSensitiveDiffs bool
ShowInsignificantDiffs bool
}
TODO: expose to the user
type DeletableResourceInfo ¶ added in v1.13.0
type DeletableResourceInfo struct {
*spec.ResourceMeta
LocalResource *resource.DeletableResource
GetResult *unstructured.Unstructured
MustDelete bool
MustTrackAbsence bool
Stage common.Stage
}
func BuildDeletableResourceInfo ¶ added in v1.13.0
func BuildDeletableResourceInfo(ctx context.Context, localRes *resource.DeletableResource, deployType common.DeployType, releaseName, releaseNamespace string, clientFactory kube.ClientFactorier) (*DeletableResourceInfo, error)
type ExecutePlanOptions ¶ added in v1.13.0
type InstallableResourceInfo ¶ added in v1.13.0
type InstallableResourceInfo struct {
*spec.ResourceMeta
LocalResource *resource.InstallableResource
GetResult *unstructured.Unstructured
DryApplyResult *unstructured.Unstructured
DryApplyErr error
MustInstall ResourceInstallType
MustDeleteOnSuccessfulInstall bool
MustDeleteOnFailedInstall bool
MustTrackReadiness bool
Stage common.Stage
Iteration int
}
func BuildInstallableResourceInfo ¶ added in v1.13.0
func BuildInstallableResourceInfo(ctx context.Context, localRes *resource.InstallableResource, deployType common.DeployType, releaseNamespace string, prevRelFailed, removeManualChanges bool, clientFactory kube.ClientFactorier) ([]*InstallableResourceInfo, error)
TODO(v2): keep annotation should probably forbid resource recreations
type Operation ¶ added in v1.13.0
type Operation struct {
Type OperationType
Version OperationVersion
Category OperationCategory
Iteration OperationIteration
Status OperationStatus
Config OperationConfig
}
type OperationCategory ¶ added in v1.13.0
type OperationCategory string
const ( OperationCategoryMeta OperationCategory = "meta" OperationCategoryResource OperationCategory = "resource" OperationCategoryTrack OperationCategory = "track" OperationCategoryRelease OperationCategory = "release" )
type OperationConfig ¶ added in v1.13.0
type OperationConfigApply ¶ added in v1.13.0
type OperationConfigApply struct {
ResourceSpec *spec.ResourceSpec
}
func (*OperationConfigApply) ID ¶ added in v1.13.0
func (c *OperationConfigApply) ID() string
func (*OperationConfigApply) IDHuman ¶ added in v1.13.0
func (c *OperationConfigApply) IDHuman() string
type OperationConfigCreate ¶ added in v1.13.0
type OperationConfigCreate struct {
ResourceSpec *spec.ResourceSpec
ForceReplicas *int
}
func (*OperationConfigCreate) ID ¶ added in v1.13.0
func (c *OperationConfigCreate) ID() string
func (*OperationConfigCreate) IDHuman ¶ added in v1.13.0
func (c *OperationConfigCreate) IDHuman() string
type OperationConfigCreateRelease ¶ added in v1.13.0
type OperationConfigCreateRelease struct {
Release *helmrelease.Release
}
func (*OperationConfigCreateRelease) ID ¶ added in v1.13.0
func (c *OperationConfigCreateRelease) ID() string
func (*OperationConfigCreateRelease) IDHuman ¶ added in v1.13.0
func (c *OperationConfigCreateRelease) IDHuman() string
type OperationConfigDelete ¶ added in v1.13.0
type OperationConfigDelete struct {
ResourceMeta *spec.ResourceMeta
}
func (*OperationConfigDelete) ID ¶ added in v1.13.0
func (c *OperationConfigDelete) ID() string
func (*OperationConfigDelete) IDHuman ¶ added in v1.13.0
func (c *OperationConfigDelete) IDHuman() string
type OperationConfigDeleteRelease ¶ added in v1.13.0
type OperationConfigDeleteRelease struct {
ReleaseName string
ReleaseNamespace string
ReleaseRevision int
}
func (*OperationConfigDeleteRelease) ID ¶ added in v1.13.0
func (c *OperationConfigDeleteRelease) ID() string
func (*OperationConfigDeleteRelease) IDHuman ¶ added in v1.13.0
func (c *OperationConfigDeleteRelease) IDHuman() string
type OperationConfigNoop ¶ added in v1.13.0
type OperationConfigNoop struct {
OpID string
}
func (*OperationConfigNoop) ID ¶ added in v1.13.0
func (c *OperationConfigNoop) ID() string
func (*OperationConfigNoop) IDHuman ¶ added in v1.13.0
func (c *OperationConfigNoop) IDHuman() string
type OperationConfigRecreate ¶ added in v1.13.0
type OperationConfigRecreate struct {
ResourceSpec *spec.ResourceSpec
ForceReplicas *int
}
func (*OperationConfigRecreate) ID ¶ added in v1.13.0
func (c *OperationConfigRecreate) ID() string
func (*OperationConfigRecreate) IDHuman ¶ added in v1.13.0
func (c *OperationConfigRecreate) IDHuman() string
type OperationConfigTrackAbsence ¶ added in v1.13.0
type OperationConfigTrackAbsence struct {
ResourceMeta *spec.ResourceMeta
}
func (*OperationConfigTrackAbsence) ID ¶ added in v1.13.0
func (c *OperationConfigTrackAbsence) ID() string
func (*OperationConfigTrackAbsence) IDHuman ¶ added in v1.13.0
func (c *OperationConfigTrackAbsence) IDHuman() string
type OperationConfigTrackPresence ¶ added in v1.13.0
type OperationConfigTrackPresence struct {
ResourceMeta *spec.ResourceMeta
}
func (*OperationConfigTrackPresence) ID ¶ added in v1.13.0
func (c *OperationConfigTrackPresence) ID() string
func (*OperationConfigTrackPresence) IDHuman ¶ added in v1.13.0
func (c *OperationConfigTrackPresence) IDHuman() string
type OperationConfigTrackReadiness ¶ added in v1.13.0
type OperationConfigTrackReadiness struct {
ResourceMeta *spec.ResourceMeta
FailMode multitrack.FailMode
FailuresAllowed int
IgnoreLogs bool
IgnoreLogsForContainers []string
IgnoreReadinessProbeFailsByContainerName map[string]time.Duration
NoActivityTimeout time.Duration
SaveEvents bool
SaveLogsByRegex *regexp.Regexp
SaveLogsByRegexForContainers map[string]*regexp.Regexp
SaveLogsOnlyForContainers []string
SaveLogsOnlyForNumberOfReplicas int
}
func (*OperationConfigTrackReadiness) ID ¶ added in v1.13.0
func (c *OperationConfigTrackReadiness) ID() string
func (*OperationConfigTrackReadiness) IDHuman ¶ added in v1.13.0
func (c *OperationConfigTrackReadiness) IDHuman() string
type OperationConfigUpdate ¶ added in v1.13.0
type OperationConfigUpdate struct {
ResourceSpec *spec.ResourceSpec
}
func (*OperationConfigUpdate) ID ¶ added in v1.13.0
func (c *OperationConfigUpdate) ID() string
func (*OperationConfigUpdate) IDHuman ¶ added in v1.13.0
func (c *OperationConfigUpdate) IDHuman() string
type OperationConfigUpdateRelease ¶ added in v1.13.0
type OperationConfigUpdateRelease struct {
Release *helmrelease.Release
}
func (*OperationConfigUpdateRelease) ID ¶ added in v1.13.0
func (c *OperationConfigUpdateRelease) ID() string
func (*OperationConfigUpdateRelease) IDHuman ¶ added in v1.13.0
func (c *OperationConfigUpdateRelease) IDHuman() string
type OperationIteration ¶ added in v1.13.0
type OperationIteration int
type OperationStatus ¶ added in v1.13.0
type OperationStatus string
const ( OperationStatusUnknown OperationStatus = "unknown" OperationStatusPending OperationStatus = "pending" OperationStatusCompleted OperationStatus = "completed" OperationStatusFailed OperationStatus = "failed" )
type OperationType ¶ added in v1.13.0
type OperationType string
const ( OperationTypeApply OperationType = "apply" OperationTypeCreate OperationType = "create" OperationTypeCreateRelease OperationType = "create-release" OperationTypeDelete OperationType = "delete" OperationTypeDeleteRelease OperationType = "delete-release" OperationTypeNoop OperationType = "noop" OperationTypeRecreate OperationType = "recreate" OperationTypeTrackAbsence OperationType = "track-absence" OperationTypeTrackPresence OperationType = "track-presence" OperationTypeTrackReadiness OperationType = "track-readiness" OperationTypeUpdate OperationType = "update" OperationTypeUpdateRelease OperationType = "update-release" )
type OperationVersion ¶ added in v1.13.0
type OperationVersion int
const ( OperationVersionApply OperationVersion = 1 OperationVersionCreate OperationVersion = 1 OperationVersionCreateRelease OperationVersion = 1 OperationVersionDelete OperationVersion = 1 OperationVersionDeleteRelease OperationVersion = 1 OperationVersionNoop OperationVersion = 1 OperationVersionRecreate OperationVersion = 1 OperationVersionTrackAbsence OperationVersion = 1 OperationVersionTrackPresence OperationVersion = 1 OperationVersionTrackReadiness OperationVersion = 1 OperationVersionUpdate OperationVersion = 1 OperationVersionUpdateRelease OperationVersion = 1 )
type Plan ¶
func BuildFailurePlan ¶ added in v1.13.0
func BuildFailurePlan(failedPlan *Plan, installableInfos []*InstallableResourceInfo, releaseInfos []*ReleaseInfo, opts BuildFailurePlanOptions) (*Plan, error)
func BuildPlan ¶ added in v1.13.0
func BuildPlan(installableInfos []*InstallableResourceInfo, deletableInfos []*DeletableResourceInfo, releaseInfos []*ReleaseInfo, opts BuildPlanOptions) (*Plan, error)
func (*Plan) AddOperationChain ¶ added in v1.13.0
func (p *Plan) AddOperationChain() *planChainBuilder
func (*Plan) Operations ¶
func (*Plan) SquashOperation ¶ added in v1.14.0
type ReleaseInfo ¶ added in v1.13.0
type ReleaseInfo struct {
Release *helmrelease.Release
Must ReleaseType
MustFailOnFailedDeploy bool
}
func BuildReleaseInfos ¶ added in v1.13.0
func BuildReleaseInfos(ctx context.Context, deployType common.DeployType, prevReleases []*helmrelease.Release, newRel *helmrelease.Release) ([]*ReleaseInfo, error)
type ReleaseType ¶ added in v1.13.0
type ReleaseType string
const ( ReleaseTypeNone ReleaseType = "none" ReleaseTypeInstall ReleaseType = "install" ReleaseTypeUpgrade ReleaseType = "upgrade" ReleaseTypeRollback ReleaseType = "rollback" ReleaseTypeSupersede ReleaseType = "supersede" ReleaseTypeUninstall ReleaseType = "uninstall" ReleaseTypeDelete ReleaseType = "delete" )
type ResourceChange ¶ added in v1.13.0
type ResourceChange struct {
ExtraOperations []string
Reason string
ResourceMeta *spec.ResourceMeta
Type string
TypeStyle color.Style
Udiff string
}
func CalculatePlannedChanges ¶
func CalculatePlannedChanges(installableInfos []*InstallableResourceInfo, deletableInfos []*DeletableResourceInfo, opts CalculatePlannedChangesOptions) ([]*ResourceChange, error)
type ResourceInstallType ¶ added in v1.13.0
type ResourceInstallType string
const ( ResourceInstallTypeNone ResourceInstallType = "none" ResourceInstallTypeCreate ResourceInstallType = "create" ResourceInstallTypeRecreate ResourceInstallType = "recreate" ResourceInstallTypeUpdate ResourceInstallType = "update" ResourceInstallTypeApply ResourceInstallType = "apply" )
Click to show internal directories.
Click to hide internal directories.