add canary-weight-total annotation (#6338)
This commit is contained in:
parent
6163231ef6
commit
5cff197bc5
7 changed files with 71 additions and 5 deletions
|
|
@ -32,6 +32,7 @@ type canary struct {
|
|||
type Config struct {
|
||||
Enabled bool
|
||||
Weight int
|
||||
WeightTotal int
|
||||
Header string
|
||||
HeaderValue string
|
||||
HeaderPattern string
|
||||
|
|
@ -59,6 +60,11 @@ func (c canary) Parse(ing *networking.Ingress) (interface{}, error) {
|
|||
config.Weight = 0
|
||||
}
|
||||
|
||||
config.WeightTotal, err = parser.GetIntAnnotation("canary-weight-total", ing)
|
||||
if err != nil {
|
||||
config.WeightTotal = 100
|
||||
}
|
||||
|
||||
config.Header, err = parser.GetStringAnnotation("canary-by-header", ing)
|
||||
if err != nil {
|
||||
config.Header = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue