traffic

package
v0.35.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compute

func Compute(cmd *cobra.Command, svc *servingv1.Service,
	trafficFlags *flags.Traffic, allRevisions []servingv1.Revision, mutation bool) ([]servingv1.TrafficTarget, error)

Compute takes service object, computes traffic per given traffic flags and returns the new traffic. If total traffic per flags < 100, the params 'revisions' and 'mutation' are used to direct remaining traffic. Param 'mutation' is set to true if a new revision will be created on service update

Types

type ServiceTraffic

type ServiceTraffic []servingv1.TrafficTarget

ServiceTraffic type for operating on service traffic targets

func (ServiceTraffic) RemoveNullTargets

func (e ServiceTraffic) RemoveNullTargets() (newTraffic ServiceTraffic)

RemoveNullTargets removes targets from traffic block if they don't have a tag and 0 percent traffic

func (ServiceTraffic) ResetAllTargetPercent

func (e ServiceTraffic) ResetAllTargetPercent()

ResetAllTargetPercent resets (0) 'Percent' field for all the traffic targets

func (ServiceTraffic) SetTrafficByLatestRevision

func (e ServiceTraffic) SetTrafficByLatestRevision(percent int64)

SetTrafficByLatestRevision sets given percent to latest ready revision of service

func (ServiceTraffic) SetTrafficByRevision

func (e ServiceTraffic) SetTrafficByRevision(revision string, percent int64)

SetTrafficByRevision checks given revision in existing traffic block and sets given percent if found

func (ServiceTraffic) SetTrafficByTag

func (e ServiceTraffic) SetTrafficByTag(tag string, percent int64)

SetTrafficByTag checks given tag in existing traffic block and sets given percent if found

func (ServiceTraffic) TagLatestRevision

func (e ServiceTraffic) TagLatestRevision(tag string) ServiceTraffic

TagLatestRevision assigns given tag to latest ready revision

func (ServiceTraffic) TagRevision

func (e ServiceTraffic) TagRevision(tag, revision string) ServiceTraffic

TagRevision assigns given tag to a revision

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL