Skip to content

Commit

Permalink
F5Networks#2963 set minimum monitors default value while creating poo…
Browse files Browse the repository at this point in the history
…l declaration
  • Loading branch information
vidyasagar-m committed Oct 10, 2023
1 parent b0c9c67 commit 2a60c2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ spec:
x-kubernetes-int-or-string: true
anyOf:
- type: integer
minimum: 1
maximum: 63
- type: string
reselectTries:
type: integer
Expand Down
7 changes: 6 additions & 1 deletion pkg/controller/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
rsc "github.com/F5Networks/k8s-bigip-ctlr/v2/pkg/resource"
log "github.com/F5Networks/k8s-bigip-ctlr/v2/pkg/vlogger"
"github.com/F5Networks/k8s-bigip-ctlr/v2/pkg/writer"
"k8s.io/apimachinery/pkg/util/intstr"
)

const (
Expand Down Expand Up @@ -847,7 +848,11 @@ func createPoolDecl(cfg *ResourceConfig, sharedApp as3Application, shareNodes bo
}
pool.Monitors = append(pool.Monitors, monitor)
}
pool.MinimumMonitors = v.MinimumMonitors
if v.MinimumMonitors.StrVal != "" || v.MinimumMonitors.IntVal != 0 {
pool.MinimumMonitors = v.MinimumMonitors
} else {
pool.MinimumMonitors = intstr.IntOrString{IntVal: 1}
}
sharedApp[v.Name] = pool
}
}
Expand Down
6 changes: 1 addition & 5 deletions pkg/controller/resourceConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,11 @@ func (ctlr *Controller) prepareRSConfigFromVirtualServer(
ServicePort: targetPort,
NodeMemberLabel: pl.NodeMemberLabel,
Balance: pl.Balance,
MinimumMonitors: pl.MinimumMonitors,
ReselectTries: pl.ReselectTries,
ServiceDownAction: pl.ServiceDownAction,
Cluster: SvcBackend.Cluster, // In all modes other than ratio, the cluster is ""
}
if pl.MinimumMonitors.StrVal != "" || pl.MinimumMonitors.IntVal != 0 {
pool.MinimumMonitors = pl.MinimumMonitors
} else {
pool.MinimumMonitors = intstr.IntOrString{IntVal: 1}
}
log.Debugf("[AS3] test the minimum monitors 123 %v", pool.MinimumMonitors)
if ctlr.multiClusterMode != "" {
//check for external service reference
Expand Down

0 comments on commit 2a60c2c

Please sign in to comment.