Documentation ¶
Index ¶
- Constants
- Variables
- type Auth
- type BasicAuth
- type ByVersion
- type DeckhouseReleaseData
- type DeckhouseUpdateSettings
- type KubeAPI
- type MetricsUpdater
- type NotificationConfig
- type Release
- type ReleaseType
- type Settings
- type Updater
- func (du *Updater[R]) ApplyForcedRelease(ctx context.Context) error
- func (du *Updater[R]) ApplyPredictedRelease(updateWindows update.Windows) error
- func (du *Updater[R]) ChangeUpdatingFlag(fl bool) error
- func (du *Updater[R]) GetCurrentDeployedReleaseIndex() int
- func (du *Updater[R]) GetPredictedRelease() R
- func (du *Updater[R]) GetPredictedReleaseIndex() int
- func (du *Updater[R]) GetSkippedPatchReleases() []R
- 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]) ReleasesCount() int
- func (du *Updater[R]) SetReleases(releases []R)
- type WebhookData
- type WebhookDataSource
Constants ¶
View Source
const ( PhasePending = "Pending" PhaseDeployed = "Deployed" PhaseSuperseded = "Superseded" PhaseSuspended = "Suspended" PhaseSkipped = "Skipped" )
View Source
const ( SubjectDeckhouse = "Deckhouse" SubjectModule = "Module" )
Variables ¶
View Source
var ( ErrNotReadyForDeploy = errors.New("not ready for deploy") ErrRequirementsNotMet = errors.New("release requirements not met") )
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type DeckhouseReleaseData ¶
type DeckhouseUpdateSettings ¶ added in v1.63.0
type DeckhouseUpdateSettings struct { NotificationConfig *NotificationConfig DisruptionApprovalMode string Mode string ClusterUUID string }
type KubeAPI ¶
type KubeAPI[R Release] interface { UpdateReleaseStatus(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 }
type MetricsUpdater ¶
type NotificationConfig ¶
type Release ¶
type Release interface { GetName() string GetModuleName() 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 ReleaseType ¶ added in v1.64.0
type ReleaseType string
const ( ReleaseTypeMinor ReleaseType = "Minor" ReleaseTypeAll ReleaseType = "All" )
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, 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
func (*Updater[R]) ChangeUpdatingFlag ¶
func (*Updater[R]) GetCurrentDeployedReleaseIndex ¶
func (*Updater[R]) GetPredictedRelease ¶ added in v1.63.0
func (du *Updater[R]) GetPredictedRelease() R
func (*Updater[R]) GetPredictedReleaseIndex ¶
func (*Updater[R]) GetSkippedPatchReleases ¶ added in v1.63.0
func (du *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 (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]) ReleasesCount ¶
func (*Updater[R]) SetReleases ¶ added in v1.63.0
func (du *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 Release] interface { Fill(output *WebhookData, release R, applyTime time.Time) }
Click to show internal directories.
Click to hide internal directories.