Documentation
¶
Index ¶
- func CalculatePartitionReplicas(totalReplicas *int32, partition intstr.IntOrString) (int32, error)
- func GetClusterFromLabel(labels map[string]string) string
- func IsWaitingRollout(info Info) bool
- func PatchMetadata(meta *metav1.ObjectMeta, patch rolloutv1alpha1.MetadataPatch)
- type Accessor
- type Info
- func (o *Info) APIStatus() rolloutv1alpha1.RolloutWorkloadStatus
- func (o *Info) CheckUpdatedReady(replicas int32) bool
- func (o *Info) NamespacedName() types.NamespacedName
- func (o *Info) String() string
- func (o *Info) UpdateOnConflict(ctx context.Context, client client.Client, mutateFn func(client.Object) error) (bool, error)
- type InfoStatus
- type Matcher
- type Registry
- type ReleaseControl
- type Set
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 IsWaitingRollout ¶ added in v0.1.1
func PatchMetadata ¶ added in v0.1.0
func PatchMetadata(meta *metav1.ObjectMeta, patch rolloutv1alpha1.MetadataPatch)
PatchMetadata patches metadata with the given patch
Types ¶
type Accessor ¶ added in v0.1.1
type Accessor interface {
GroupVersionKind() schema.GroupVersionKind
// NewObject returns a new instance of the workload type
NewObject() client.Object
// NewObjectList returns a new instance of the workload list type
NewObjectList() client.ObjectList
// Watchable indicates whether this workload type can be watched from the API server.
Watchable() bool
// GetInfo returns a info represent workload
GetInfo(cluster string, obj client.Object) (*Info, error)
// ReleaseControl returns the release control for the workload
ReleaseControl() ReleaseControl
}
Accessor defines the functions to access the workload.
type Info ¶
type Info struct {
metav1.ObjectMeta
// GVK is the GroupVersionKind of the workload.
schema.GroupVersionKind
// Status is the status of the workload.
Status InfoStatus
// Object is the object representing the workload.
Object client.Object
}
workload info
func List ¶ added in v0.1.1
func List(ctx context.Context, c client.Client, inter Accessor, namespace string, match rolloutv1alpha1.ResourceMatch) ([]*Info, error)
func NewInfo ¶
func NewInfo(cluster string, gvk schema.GroupVersionKind, obj client.Object, status InfoStatus) *Info
func (*Info) APIStatus ¶ added in v0.1.0
func (o *Info) APIStatus() rolloutv1alpha1.RolloutWorkloadStatus
func (*Info) CheckUpdatedReady ¶ added in v0.1.1
func (*Info) NamespacedName ¶ added in v0.1.0
func (o *Info) NamespacedName() types.NamespacedName
type InfoStatus ¶ added in v0.1.1
type InfoStatus 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 Matcher ¶ added in v0.1.1
func MatchAsMatcher ¶
func MatchAsMatcher(match rolloutv1alpha1.ResourceMatch) Matcher
type Registry ¶ added in v0.1.1
type Registry interface {
// SetupWithManger initialize registry with manager.
SetupWithManger(mgr manager.Manager)
// Register add a new workload Accessor for given gvk
Register(accessor Accessor)
// Delete delete a new workload Accessor for given gvk
Delete(gvk schema.GroupVersionKind)
// If the gvk is registered and supported by all member clusters, Get returns the workload Accessor.
Get(gvk schema.GroupVersionKind) (Accessor, error)
// Watchables return all watchable and supported Accessor.
Watchables() []Accessor
}
func NewRegistry ¶ added in v0.1.1
func NewRegistry() Registry
type ReleaseControl ¶ added in v0.1.1
type ReleaseControl interface {
// BatchPreCheck checks object before batch release.
BatchPreCheck(obj client.Object) error
// ApplyPartition applies partition to the workload
ApplyPartition(obj client.Object, partition intstr.IntOrString) error
// CanaryPreCheck checks object before canary release.
CanaryPreCheck(obj client.Object) error
// Scale scales the workload replicas.
Scale(obj client.Object, replicas int32) error
// ApplyCanaryPatch applies canary to the workload.
ApplyCanaryPatch(canary client.Object, podTemplatePatch *v1alpha1.MetadataPatch) error
}
ReleaseControl defines the control functions for workload release
Click to show internal directories.
Click to hide internal directories.