Documentation
¶
Index ¶
- func CalculatePartitionReplicas(totalReplicas *int32, partition intstr.IntOrString) (int32, error)
- func GetClusterFromLabel(labels map[string]string) string
- func PatchMetadata(meta *metav1.ObjectMeta, patch rolloutv1alpha1.MetadataPatch)
- type BatchStrategy
- type CanaryInterface
- type CanaryStrategy
- type Info
- type Interface
- type Set
- type StableInterface
- type Status
- type WorkloadMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePartitionReplicas ¶
func CalculatePartitionReplicas(totalReplicas *int32, partition intstr.IntOrString) (int32, error)
func GetClusterFromLabel ¶
func PatchMetadata ¶ added in v0.1.0
func PatchMetadata(meta *metav1.ObjectMeta, patch rolloutv1alpha1.MetadataPatch)
PatchMetadata patches metadata with the given patch
Types ¶
type BatchStrategy ¶ added in v0.1.0
type BatchStrategy interface {
// Initialize initializes the stable workload.
// It claims the stable workload is in batch release process controlled by rolloutRun
Initialize(rollout, rolloutRun string, batchIndex int32) error
// UpgradePartition upgrades the workload to the specified partition
// It should return true if the workload changed.
//
// NOTE: This function must be idempotent.
UpgradePartition(partition intstr.IntOrString) (bool, error)
}
type CanaryInterface ¶ added in v0.1.0
type CanaryInterface interface {
// CreateOrUpdate ensures the canary workload is created and updated.
CreateOrUpdate(canaryReplicas intstr.IntOrString, podTemplatePatch *rolloutv1alpha1.MetadataPatch) (controllerutil.OperationResult, error)
// GetInfo returns basic canary workload informations.
GetCanaryInfo() Info
// Delete delete canary resources
Delete() error
}
type CanaryStrategy ¶ added in v0.1.0
type CanaryStrategy interface {
StableInterface
CanaryInterface
}
type Info ¶
type Info struct {
metav1.ObjectMeta
// GVK is the GroupVersionKind of the workload.
schema.GroupVersionKind
// Status is the status of the workload.
Status Status
}
workload info
func NewInfoFrom ¶ added in v0.1.0
func (Info) APIStatus ¶ added in v0.1.0
func (o Info) APIStatus() rolloutv1alpha1.RolloutWorkloadStatus
func (Info) CheckPartitionReady ¶ added in v0.1.0
func (Info) NamespacedName ¶ added in v0.1.0
func (o Info) NamespacedName() types.NamespacedName
type Interface ¶
type Interface interface {
// GetInfo returns basic workload informations.
GetInfo() Info
// IsWaitingRollout returns if the workload is waiting for rollout.
IsWaitingRollout() bool
// UpdateOnConflict try its best to updates the workload on conflict.
UpdateOnConflict(ctx context.Context, modifyFunc func(obj client.Object) error) error
// CanaryStrategy returns an interface for managing the canary strategy process.
CanaryStrategy() (CanaryStrategy, error)
// BatchStrategy returns an interface for managing the batch strategy process.
BatchStrategy() BatchStrategy
}
Interface is the interface for workload
type StableInterface ¶ added in v0.1.0
type StableInterface interface {
// Initialize initializes the stable workload.
// It claims the stable workload is in canary release process controlled by rolloutRun
Initialize(rollout, rolloutRun string) error
// GetStableInfo returns basic stable workload informations.
GetStableInfo() Info
// Finalize finalizes the stable workload.
Finalize() error
}
type Status ¶ added in v0.1.0
type Status struct {
// ObservedGeneration is the most recent generation observed for this workload.
ObservedGeneration int64
// StableRevision is the old stable revision used to generate pods.
StableRevision string
// UpdatedRevision is the updated template revision used to generate pods.
UpdatedRevision string
// Replicas is the desired number of pods targeted by workload
Replicas int32
// UpdatedReplicas is the number of pods targeted by workload that have the updated template spec.
UpdatedReplicas int32
// UpdatedReadyReplicas is the number of ready pods targeted by workload that have the updated template spec.
UpdatedReadyReplicas int32
// UpdatedAvailableReplicas is the number of service available pods targeted by workload that have the updated template spec.
UpdatedAvailableReplicas int32
}
workload status
type WorkloadMatcher ¶
func MatchAsMatcher ¶
func MatchAsMatcher(match rolloutv1alpha1.ResourceMatch) WorkloadMatcher
Click to show internal directories.
Click to hide internal directories.