Documentation ¶
Index ¶
- func GetGraceSeconds(refs []v1beta1.TrafficRoutingRef, defaultSeconds int32) (graceSeconds int32)
- func UpdateRecheckDuration(c *TrafficRoutingContext, remaining time.Duration)
- type Manager
- func (m *Manager) DoTrafficRouting(c *TrafficRoutingContext) (bool, error)
- func (m *Manager) FinalisingTrafficRouting(c *TrafficRoutingContext) (bool, error)
- func (m *Manager) InitializeTrafficRouting(c *TrafficRoutingContext) error
- func (m *Manager) PatchStableService(c *TrafficRoutingContext) (bool, error)
- func (m *Manager) RemoveCanaryService(c *TrafficRoutingContext) (bool, error)
- func (m *Manager) RestoreGateway(c *TrafficRoutingContext) (bool, error)
- func (m *Manager) RestoreStableService(c *TrafficRoutingContext) (bool, error)
- func (m *Manager) RouteAllTrafficToNewVersion(c *TrafficRoutingContext) (bool, error)
- type TrafficRoutingContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGraceSeconds ¶ added in v0.6.0
func GetGraceSeconds(refs []v1beta1.TrafficRoutingRef, defaultSeconds int32) (graceSeconds int32)
func UpdateRecheckDuration ¶ added in v0.6.0
func UpdateRecheckDuration(c *TrafficRoutingContext, remaining time.Duration)
Types ¶
type Manager ¶
Manager responsible for adjusting network resources such as Service, Ingress, Gateway API, etc., to achieve traffic grayscale.
func (*Manager) DoTrafficRouting ¶
func (m *Manager) DoTrafficRouting(c *TrafficRoutingContext) (bool, error)
func (*Manager) FinalisingTrafficRouting ¶
func (m *Manager) FinalisingTrafficRouting(c *TrafficRoutingContext) (bool, error)
func (*Manager) InitializeTrafficRouting ¶
func (m *Manager) InitializeTrafficRouting(c *TrafficRoutingContext) error
InitializeTrafficRouting determine if the network resources(service & ingress & gateway api) exist. If it is Ingress, init method will create the canary ingress resources, and set weight=0.
func (*Manager) PatchStableService ¶ added in v0.6.0
func (m *Manager) PatchStableService(c *TrafficRoutingContext) (bool, error)
returns:
- if error is not nil, usually we need to retry later. Only if error is nil, we consider the bool.
- The bool value indicates whether retry is needed. If true, it usually means stable service has been updated (ie. patched) and we need to wait for `graceSeconds`.
only if error is nil AND retry is false, this calling can be considered as completed
func (*Manager) RemoveCanaryService ¶ added in v0.6.0
func (m *Manager) RemoveCanaryService(c *TrafficRoutingContext) (bool, error)
returns:
- if error is not nil, usually we need to retry later. Only if error is nil, we consider the bool.
- The bool value indicates whether retry is needed. If true, it usually means canary service has been deleted and we need to wait for `graceSeconds`.
only if error is nil AND retry is false, this calling can be considered as completed
func (*Manager) RestoreGateway ¶ added in v0.6.0
func (m *Manager) RestoreGateway(c *TrafficRoutingContext) (bool, error)
returns:
- if error is not nil, usually we need to retry later. Only if error is nil, we consider the bool.
- The bool value indicates whether retry is needed. If true, it usually means gateway resources have been updated and we need to wait for `graceSeconds`.
only if error is nil AND retry is false, this calling can be considered as completed
func (*Manager) RestoreStableService ¶ added in v0.6.0
func (m *Manager) RestoreStableService(c *TrafficRoutingContext) (bool, error)
remove stable service the pod revision selector, so stable service will be selector all version pods. returns:
- if error is not nil, usually we need to retry later. Only if error is nil, we consider the bool.
- The bool value indicates whether retry is needed. If true, it usually means stable service has been updated (ie. restored) and we need to wait for `graceSeconds`.
only if error is nil AND retry is false, this calling can be considered as completed
func (*Manager) RouteAllTrafficToNewVersion ¶ added in v0.6.0
func (m *Manager) RouteAllTrafficToNewVersion(c *TrafficRoutingContext) (bool, error)
returns:
- if error is not nil, usually we need to retry later. Only if error is nil, we consider the bool.
- The bool value indicates whether retry is needed. If true, it usually means gateway resources have been updated and we need to wait for `graceSeconds`.
only if error is nil AND retry is false, this calling can be considered as completed
type TrafficRoutingContext ¶ added in v0.4.0
type TrafficRoutingContext struct { // only for log info Key string Namespace string ObjectRef []v1beta1.TrafficRoutingRef Strategy v1beta1.TrafficRoutingStrategy CanaryServiceSelectorPatch map[string]string // OnlyTrafficRouting OnlyTrafficRouting bool OwnerRef metav1.OwnerReference // workload.RevisionLabelKey RevisionLabelKey string // status.CanaryStatus.StableRevision StableRevision string // status.CanaryStatus.PodTemplateHash CanaryRevision string // newStatus.canaryStatus.LastUpdateTime LastUpdateTime *metav1.Time // won't work for Ingress and Gateway DisableGenerateCanaryService bool // recheck time RecheckDuration time.Duration }