Documentation ¶
Index ¶
- Constants
- type Auth
- type BasicAuth
- type ByVersion
- type DeckhouseReleaseData
- type KubeAPI
- type MetricsUpdater
- type NotificationConfig
- type Release
- type Settings
- type Updater
- func (du *Updater[R]) ApplyForcedRelease()
- func (du *Updater[R]) ApplyPredictedRelease(updateWindows update.Windows) bool
- func (du *Updater[R]) ChangeUpdatingFlag(fl bool) error
- func (du *Updater[R]) GetCurrentDeployedReleaseIndex() int
- func (du *Updater[R]) GetPredictedReleaseIndex() int
- func (du *Updater[R]) GetSkippedPatchesIndexes() []int
- func (du *Updater[R]) HasForceRelease() bool
- func (du *Updater[R]) InManualMode() bool
- func (du *Updater[R]) LastReleaseDeployed() bool
- func (du *Updater[R]) PredictNextRelease()
- func (du *Updater[R]) PredictedReleaseIsPatch() bool
- func (du *Updater[R]) PrepareReleases(releases []R)
- func (du *Updater[R]) ReleasesCount() int
- type WebhookDataGetter
Constants ¶
View Source
const ( PhasePending = "Pending" PhaseDeployed = "Deployed" PhaseSuperseded = "Superseded" PhaseSuspended = "Suspended" PhaseSkipped = "Skipped" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type DeckhouseReleaseData ¶
type KubeAPI ¶
type KubeAPI[R Release] interface { UpdateReleaseStatus(release R, msg, phase string) error PatchReleaseAnnotations(release R, annotations map[string]interface{}) error PatchReleaseApplyAfter(release R, applyTime time.Time) error SaveReleaseData(release R, data DeckhouseReleaseData) error DeployRelease(release R) error }
type MetricsUpdater ¶
type NotificationConfig ¶
type NotificationConfig struct { WebhookURL string `json:"webhook"` SkipTLSVerify bool `json:"tlsSkipVerify"` MinimalNotificationTime libapi.Duration `json:"minimalNotificationTime"` Auth *Auth `json:"auth,omitempty"` }
func ParseNotificationConfigFromValues ¶
func ParseNotificationConfigFromValues(input *go_hook.HookInput) (*NotificationConfig, error)
type Release ¶
type Release interface { GetName() string GetApplyAfter() *time.Time GetVersion() *semver.Version GetRequirements() map[string]string GetChangelogLink() string GetCooldownUntil() *time.Time GetDisruptions() []string GetDisruptionApproved() bool GetPhase() string GetForce() bool GetApplyNow() bool GetApprovedStatus() bool SetApprovedStatus(b bool) GetSuspend() bool GetManuallyApproved() bool GetMessage() string }
type Updater ¶
type Updater[R Release] struct { // contains filtered or unexported fields }
func NewUpdater ¶
func NewUpdater[R Release](logger logger.Logger, notificationConfig *NotificationConfig, mode string, data DeckhouseReleaseData, podIsReady, isBootstrapping bool, kubeAPI KubeAPI[R], metricsUpdater MetricsUpdater, settings Settings, webhookDataGetter WebhookDataGetter[R]) *Updater[R]
func (*Updater[R]) ApplyForcedRelease ¶
func (du *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
func (*Updater[R]) ChangeUpdatingFlag ¶
func (*Updater[R]) GetCurrentDeployedReleaseIndex ¶
func (*Updater[R]) GetPredictedReleaseIndex ¶
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 (du *Updater[R]) PredictNextRelease()
PredictNextRelease runs prediction of the next release to deploy. it skips patch releases and save only the latest one
func (*Updater[R]) PredictedReleaseIsPatch ¶
PredictedReleaseIsPatch shows if the predicted release is a patch with respect to the Deployed one
func (*Updater[R]) PrepareReleases ¶
func (du *Updater[R]) PrepareReleases(releases []R)
PrepareReleases fetches releases from snapshot and then:
- patch releases with empty status (just created)
- handle suspended releases (patch status and remove annotation)
- patch manual releases (change status)
func (*Updater[R]) ReleasesCount ¶
Click to show internal directories.
Click to hide internal directories.