Documentation ¶
Index ¶
- Constants
- Variables
- type Auth
- type BasicAuth
- type ByVersion
- type DeckhouseReleaseData
- type KubeAPI
- type MetricLabels
- type MetricsUpdater
- type NotReadyForDeployError
- type NotificationConfig
- type ReleaseType
- type Settings
- type UpdateMode
- type Updater
- func (u *Updater[R]) ApplyForcedRelease(ctx context.Context) error
- func (u *Updater[R]) ApplyPredictedRelease() (err error)
- func (u *Updater[R]) ChangeUpdatingFlag(fl bool) error
- func (u *Updater[R]) CommitSkippedReleases() error
- func (u *Updater[R]) DeployedRelease() *R
- func (u *Updater[R]) GetCurrentDeployedReleaseIndex() int
- func (u *Updater[R]) GetPredictedRelease() R
- func (u *Updater[R]) GetPredictedReleaseIndex() int
- func (u *Updater[R]) GetSkippedPatchReleases() []R
- func (u *Updater[R]) GetSkippedPatchesIndexes() []int
- func (u *Updater[R]) HasForceRelease() bool
- func (u *Updater[R]) InManualMode() bool
- func (u *Updater[R]) LastReleaseDeployed() bool
- func (u *Updater[R]) PredictNextRelease(release R)
- func (u *Updater[R]) PredictedReleaseIsPatch() bool
- func (u *Updater[R]) ReleasesCount() int
- func (u *Updater[R]) SetReleases(releases []R)
- type WebhookData
- type WebhookDataSource
Constants ¶
const ( ManualApprovalRequired = "manualApproval" DisruptionApprovalRequired = "disruptionApproval" RequirementsNotMet = "requirementsNotMet" ReleaseQueueDepth = "releaseQueueDepth" NotificationNotSent = "notificationNotSent" )
const ( PhasePending = "Pending" PhaseDeployed = "Deployed" PhaseSuperseded = "Superseded" PhaseSuspended = "Suspended" PhaseSkipped = "Skipped" )
const ( SubjectDeckhouse = "Deckhouse" SubjectModule = "Module" )
Variables ¶
var ErrDeployConditionsNotMet = NewNotReadyForDeployError("deploy conditions not met", 0)
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type DeckhouseReleaseData ¶
type KubeAPI ¶
type KubeAPI[R v1alpha1.Release] interface { UpdateReleaseStatus(ctx context.Context, release R, msg, phase string) error PatchReleaseAnnotations(ctx context.Context, release R, annotations map[string]interface{}) error PatchReleaseApplyAfter(release R, applyTime time.Time) error SaveReleaseData(ctx context.Context, release R, data DeckhouseReleaseData) error DeployRelease(ctx context.Context, release R) error IsKubernetesVersionAutomatic(ctx context.Context) (bool, error) }
type MetricLabels ¶ added in v1.67.0
func NewReleaseMetricLabels ¶ added in v1.67.0
func NewReleaseMetricLabels(release v1alpha1.Release) MetricLabels
type MetricsUpdater ¶
type MetricsUpdater[R v1alpha1.Release] interface { UpdateReleaseMetric(string, MetricLabels) PurgeReleaseMetric(string) }
type NotReadyForDeployError ¶ added in v1.65.0
type NotReadyForDeployError struct {
// contains filtered or unexported fields
}
func NewNotReadyForDeployError ¶ added in v1.65.0
func NewNotReadyForDeployError(message string, retryDelay time.Duration) *NotReadyForDeployError
func (*NotReadyForDeployError) Error ¶ added in v1.65.0
func (n *NotReadyForDeployError) Error() string
func (*NotReadyForDeployError) RetryDelay ¶ added in v1.65.0
func (n *NotReadyForDeployError) RetryDelay() time.Duration
type NotificationConfig ¶
type ReleaseType ¶ added in v1.64.0
type ReleaseType string
const ( ReleaseTypeMinor ReleaseType = "Minor" ReleaseTypeAll ReleaseType = "All" )
type Settings ¶
type Settings struct { NotificationConfig NotificationConfig DisruptionApprovalMode string Mode UpdateMode Windows update.Windows }
type UpdateMode ¶ added in v1.65.0
type UpdateMode string
const ( // ModeAutoPatch is default mode for updater, // deckhouse automatically applies patch releases, but asks for approval of minor releases ModeAutoPatch UpdateMode = "AutoPatch" // ModeAuto is updater mode when deckhouse automatically applies all releases ModeAuto UpdateMode = "Auto" // ModeManual is updater mode when deckhouse downloads releases info, but does not apply them ModeManual UpdateMode = "Manual" )
func ParseUpdateMode ¶ added in v1.65.0
func ParseUpdateMode(name string) UpdateMode
ParseUpdateMode attempts to convert a string to a UpdateMode.
AutoPatch used by default
func (UpdateMode) IsValid ¶ added in v1.65.0
func (x UpdateMode) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (UpdateMode) String ¶ added in v1.65.0
func (x UpdateMode) String() string
String implements the Stringer interface.
type Updater ¶
func NewUpdater ¶
func NewUpdater[R v1alpha1.Release]( ctx context.Context, dc dependency.Container, logger *log.Logger, settings *Settings, data DeckhouseReleaseData, podIsReady, isBootstrapping bool, kubeAPI KubeAPI[R], metricsUpdater MetricsUpdater[R], webhookDataSource WebhookDataSource[R], enabledModules []string, ) *Updater[R]
func (*Updater[R]) ApplyForcedRelease ¶
ApplyForcedRelease deploys forced release without any checks (windows, requirements, approvals and so on)
func (*Updater[R]) ApplyPredictedRelease ¶
ApplyPredictedRelease applies predicted release, checks everything:
- Deckhouse is ready (except patch)
- Canary settings
- Manual approving
- Release requirements
In addition to the regular error, ErrDeployConditionsNotMet or NotReadyForDeployError is returned as appropriate.
func (*Updater[R]) ChangeUpdatingFlag ¶
func (*Updater[R]) CommitSkippedReleases ¶ added in v1.67.0
func (*Updater[R]) DeployedRelease ¶ added in v1.65.0
func (u *Updater[R]) DeployedRelease() *R
func (*Updater[R]) GetCurrentDeployedReleaseIndex ¶
func (*Updater[R]) GetPredictedRelease ¶ added in v1.63.0
func (u *Updater[R]) GetPredictedRelease() R
func (*Updater[R]) GetPredictedReleaseIndex ¶
func (*Updater[R]) GetSkippedPatchReleases ¶ added in v1.63.0
func (u *Updater[R]) GetSkippedPatchReleases() []R
func (*Updater[R]) GetSkippedPatchesIndexes ¶
func (*Updater[R]) HasForceRelease ¶
HasForceRelease check the existence of the forced release
func (*Updater[R]) InManualMode ¶
func (*Updater[R]) LastReleaseDeployed ¶
LastReleaseDeployed returns the equality of the latest existed release with the latest deployed
func (*Updater[R]) PredictNextRelease ¶
func (u *Updater[R]) PredictNextRelease(release R)
PredictNextRelease runs prediction of the next release to deploy. It skips patch releases and saves only the latest one. Also, the metrics of the referenced release are updated.
func (*Updater[R]) PredictedReleaseIsPatch ¶
PredictedReleaseIsPatch shows if the predicted release is a patch with respect to the Deployed one
func (*Updater[R]) ReleasesCount ¶
func (*Updater[R]) SetReleases ¶ added in v1.63.0
func (u *Updater[R]) SetReleases(releases []R)
SetReleases set and sort releases for updater
type WebhookData ¶ added in v1.64.0
type WebhookData struct { Subject string `json:"subject"` Version string `json:"version"` Requirements map[string]string `json:"requirements,omitempty"` ChangelogLink string `json:"changelogLink,omitempty"` ModuleName string `json:"moduleName,omitempty"` ApplyTime string `json:"applyTime,omitempty"` Message string `json:"message"` }
type WebhookDataSource ¶ added in v1.64.0
type WebhookDataSource[R v1alpha1.Release] interface { Fill(output *WebhookData, release R, applyTime time.Time) }