Fix a bug with Canary becoming main server
This commit is contained in:
parent
cc2b54472a
commit
af460f7e15
4 changed files with 449 additions and 28 deletions
|
|
@ -940,8 +940,13 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
|
|||
// default upstream name
|
||||
un := du.Name
|
||||
|
||||
if anns.Canary.Enabled {
|
||||
klog.V(2).Infof("Ingress %v is marked as Canary, ignoring", ingKey)
|
||||
continue
|
||||
}
|
||||
|
||||
if ing.Spec.Backend != nil {
|
||||
defUpstream := fmt.Sprintf("%v-%v-%v", ing.Namespace, ing.Spec.Backend.ServiceName, ing.Spec.Backend.ServicePort.String())
|
||||
defUpstream := upstreamName(ing.Namespace, ing.Spec.Backend.ServiceName, ing.Spec.Backend.ServicePort)
|
||||
|
||||
if backendUpstream, ok := upstreams[defUpstream]; ok {
|
||||
// use backend specified in Ingress as the default backend for all its rules
|
||||
|
|
@ -1016,6 +1021,11 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
|
|||
ingKey := k8s.MetaNamespaceKey(ing)
|
||||
anns := ing.ParsedAnnotations
|
||||
|
||||
if anns.Canary.Enabled {
|
||||
klog.V(2).Infof("Ingress %v is marked as Canary, ignoring", ingKey)
|
||||
continue
|
||||
}
|
||||
|
||||
for _, rule := range ing.Spec.Rules {
|
||||
host := rule.Host
|
||||
if host == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue