Documentation
¶
Index ¶
- Constants
- Variables
- type Auth
- type BasicAuth
- type ByVersion
- type Check
- type Checker
- func NewDeckhouseReleaseRequirementsChecker(k8sclient client.Client, enabledModules []string, logger *log.Logger) (*Checker[v1alpha1.DeckhouseRelease], error)
- func NewModuleReleaseRequirementsChecker(logger *log.Logger) (*Checker[v1alpha1.ModuleRelease], error)
- func NewPreApplyChecker(settings *Settings, logger *log.Logger) *Checker[v1alpha1.Release]
- type DeployDelayReason
- type DeployTimeResult
- type DeployTimeService
- func (c *DeployTimeService) CalculateMinorDeployTime(release v1alpha1.Release, metricLabels MetricLabels) *DeployTimeResult
- func (c *DeployTimeService) CalculatePatchDeployTime(release v1alpha1.Release, metricLabels MetricLabels) *DeployTimeResult
- func (c *DeployTimeService) ProcessMinorReleaseDeployTime(release v1alpha1.Release, res *DeployTimeResult) *ProcessedDeployTimeResult
- func (c *DeployTimeService) ProcessPatchReleaseDeployTime(release v1alpha1.Release, res *DeployTimeResult) *ProcessedDeployTimeResult
- type MetricLabels
- type MetricsUpdater
- type NotMetReason
- type NotificationConfig
- type ProcessedDeployTimeResult
- type ReleaseInfo
- type ReleaseNotifier
- type ReleaseType
- type RequirementsChecker
- type Settings
- type StatusPatch
- type Task
- type TaskCalculator
- type TaskType
- type WebhookData
Constants ¶
const ( ManualApprovalRequired = "manualApproval" DisruptionApprovalRequired = "disruptionApproval" RequirementsNotMet = "requirementsNotMet" ReleaseQueueDepth = "releaseQueueDepth" NotificationNotSent = "notificationNotSent" )
const ( SubjectDeckhouse = "Deckhouse" SubjectModule = "Module" )
const D8ReleaseBlockedMetricName = "d8_release_info"
const ModuleReleaseBlockedMetricName = "d8_module_release_info"
Variables ¶
var ErrReleaseIsAlreadyDeployed = errors.New("release is already deployed")
var ErrReleasePhaseIsNotPending = errors.New("release phase is not pending")
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Checker ¶
type Checker[T any] struct { // contains filtered or unexported fields }
func NewDeckhouseReleaseRequirementsChecker ¶
func NewDeckhouseReleaseRequirementsChecker(k8sclient client.Client, enabledModules []string, logger *log.Logger) (*Checker[v1alpha1.DeckhouseRelease], error)
NewDeckhouseReleaseRequirementsChecker returns DeckhouseRelease checker with this checks:
1) deckhouse version check 2) deckhouse requirements check 3) deckhouse kubernetes version check
for more checks information - look at extenders
func NewModuleReleaseRequirementsChecker ¶
func NewModuleReleaseRequirementsChecker(logger *log.Logger) (*Checker[v1alpha1.ModuleRelease], error)
NewModuleReleaseRequirementsChecker returns ModuleRelease checker with this checks:
1) module release requirements check
for more checks information - look at extenders
func NewPreApplyChecker ¶
NewPreApplyChecker returns Release checker with this checks:
1) disruption check
func (*Checker[T]) MetRequirements ¶
func (c *Checker[T]) MetRequirements(v *T) []NotMetReason
type DeployDelayReason ¶
type DeployDelayReason byte
func (DeployDelayReason) GoString ¶
func (r DeployDelayReason) GoString() string
func (DeployDelayReason) IsNoDelay ¶
func (r DeployDelayReason) IsNoDelay() bool
func (DeployDelayReason) String ¶
func (r DeployDelayReason) String() string
type DeployTimeResult ¶
type DeployTimeResult struct {
ReleaseApplyTime time.Time
ReleaseApplyAfterTime time.Time
Reason DeployDelayReason
}
type DeployTimeService ¶
type DeployTimeService struct {
// contains filtered or unexported fields
}
func NewDeployTimeService ¶
func NewDeployTimeService(dc dependency.Container, settings *Settings, logger *log.Logger) *DeployTimeService
func (*DeployTimeService) CalculateMinorDeployTime ¶
func (c *DeployTimeService) CalculateMinorDeployTime(release v1alpha1.Release, metricLabels MetricLabels) *DeployTimeResult
CalculatePatchDeployTime calculates deploy time, returns deploy time or postpone time and reason. To calculate deploy time, we need to check:
1) Cooldown (TODO: deprecated?) 1) Canary (in any mode, except "Manual") 2) Notify 3) Window (only in "Auto" mode) 4) Manual approve (in any mode, except "Auto")
Notify reason must override any other reason
func (*DeployTimeService) CalculatePatchDeployTime ¶
func (c *DeployTimeService) CalculatePatchDeployTime(release v1alpha1.Release, metricLabels MetricLabels) *DeployTimeResult
CalculatePatchDeployTime calculates deploy time, returns deploy time or postpone time and reason. To calculate deploy time, we need to check:
1) Canary 2) Notify 3) Window (only in "AutoPatch" mode) 4) Manual approve (only in "Manual" mode)
Notify reason must override any other reason
func (*DeployTimeService) ProcessMinorReleaseDeployTime ¶
func (c *DeployTimeService) ProcessMinorReleaseDeployTime(release v1alpha1.Release, res *DeployTimeResult) *ProcessedDeployTimeResult
ProcessMinorReleaseDeployTime for minor release we check: - Deckhouse pod is ready - No delay from calculated deploy time
func (*DeployTimeService) ProcessPatchReleaseDeployTime ¶
func (c *DeployTimeService) ProcessPatchReleaseDeployTime(release v1alpha1.Release, res *DeployTimeResult) *ProcessedDeployTimeResult
ProcessPatchReleaseDeployTime for patch release we check: - No delay from calculated deploy time
type MetricLabels ¶
func NewReleaseMetricLabels ¶
func NewReleaseMetricLabels(release v1alpha1.Release) MetricLabels
func (MetricLabels) SetFalse ¶
func (ml MetricLabels) SetFalse(key string)
func (MetricLabels) SetTrue ¶
func (ml MetricLabels) SetTrue(key string)
type MetricsUpdater ¶
type MetricsUpdater struct {
// contains filtered or unexported fields
}
func NewMetricsUpdater ¶
func NewMetricsUpdater(metricStorage metric.Storage, metricName string) *MetricsUpdater
func (*MetricsUpdater) PurgeReleaseMetric ¶
func (mu *MetricsUpdater) PurgeReleaseMetric(name string)
func (*MetricsUpdater) UpdateReleaseMetric ¶
func (mu *MetricsUpdater) UpdateReleaseMetric(name string, metricLabels MetricLabels)
type NotMetReason ¶
type NotificationConfig ¶
type NotificationConfig struct {
WebhookURL string `json:"webhook"`
SkipTLSVerify bool `json:"tlsSkipVerify"`
MinimalNotificationTime libapi.Duration `json:"minimalNotificationTime"`
Auth *Auth `json:"auth,omitempty"`
ReleaseType ReleaseType `json:"releaseType"`
}
func (*NotificationConfig) IsEmpty ¶
func (cfg *NotificationConfig) IsEmpty() bool
type ProcessedDeployTimeResult ¶
type ProcessedDeployTimeResult struct {
Reason DeployDelayReason
Message string
ReleaseApplyAfterTime time.Time
}
type ReleaseInfo ¶
type ReleaseNotifier ¶
type ReleaseNotifier struct {
// contains filtered or unexported fields
}
func NewReleaseNotifier ¶
func NewReleaseNotifier(settings *Settings) *ReleaseNotifier
func (*ReleaseNotifier) SendMinorReleaseNotification ¶
func (u *ReleaseNotifier) SendMinorReleaseNotification(ctx context.Context, release v1alpha1.Release, applyTime time.Time, metricLabels MetricLabels) error
func (*ReleaseNotifier) SendPatchReleaseNotification ¶
func (u *ReleaseNotifier) SendPatchReleaseNotification(ctx context.Context, release v1alpha1.Release, applyTime time.Time, metricLabels MetricLabels) error
SendPatchReleaseNotification sending patch notification (only if notification config has release type "All")
type ReleaseType ¶
type ReleaseType string
const ( ReleaseTypeMinor ReleaseType = "Minor" ReleaseTypeAll ReleaseType = "All" )
type RequirementsChecker ¶
type RequirementsChecker[T any] interface { MetRequirements(v *T) []NotMetReason }
type Settings ¶
type Settings struct {
NotificationConfig NotificationConfig
DisruptionApprovalMode string
Mode v1alpha1.UpdateMode
Windows update.Windows
Subject string
}
func (*Settings) InDisruptionApprovalMode ¶
func (*Settings) InManualMode ¶
type StatusPatch ¶
type StatusPatch v1alpha1.DeckhouseReleaseStatus
TODO: replace patch marshalling with controller-runtime patch
func (StatusPatch) MarshalJSON ¶
func (sp StatusPatch) MarshalJSON() ([]byte, error)
type TaskCalculator ¶
type TaskCalculator struct {
// contains filtered or unexported fields
}
func NewDeckhouseReleaseTaskCalculator ¶
func NewDeckhouseReleaseTaskCalculator(k8sclient client.Client, logger *log.Logger) *TaskCalculator
func NewModuleReleaseTaskCalculator ¶
func NewModuleReleaseTaskCalculator(k8sclient client.Client, logger *log.Logger) *TaskCalculator
func (*TaskCalculator) CalculatePendingReleaseTask ¶
func (p *TaskCalculator) CalculatePendingReleaseTask(ctx context.Context, release v1alpha1.Release) (*Task, error)
CalculatePendingReleaseTask calculate task with information about current reconcile
calculating flow: 1) find forced release. if current release has a lower version - skip 2) find deployed release. if current release has a lower version - skip