mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Moved nil check inside AlphaFeatureGate.Enabled
This commit is contained in:
parent
da887e85e9
commit
501081e64f
@ -38,6 +38,9 @@ type AlphaFeatureGate struct {
|
||||
|
||||
// Enabled returns true if the provided alpha feature is enabled
|
||||
func (af *AlphaFeatureGate) Enabled(key string) bool {
|
||||
if af == nil || af.features == nil {
|
||||
return false
|
||||
}
|
||||
return af.features[key]
|
||||
}
|
||||
|
||||
|
@ -36,12 +36,8 @@ const (
|
||||
allInstances = "ALL"
|
||||
)
|
||||
|
||||
func (g *Cloud) usesSubsets() bool {
|
||||
return g.AlphaFeatureGate != nil && g.AlphaFeatureGate.Enabled(AlphaFeatureILBSubsets)
|
||||
}
|
||||
|
||||
func (g *Cloud) ensureInternalLoadBalancer(clusterName, clusterID string, svc *v1.Service, existingFwdRule *compute.ForwardingRule, nodes []*v1.Node) (*v1.LoadBalancerStatus, error) {
|
||||
if g.usesSubsets() {
|
||||
if g.AlphaFeatureGate.Enabled(AlphaFeatureILBSubsets) {
|
||||
return nil, cloudprovider.ImplementedElsewhere
|
||||
}
|
||||
|
||||
@ -210,7 +206,7 @@ func (g *Cloud) clearPreviousInternalResources(svc *v1.Service, loadBalancerName
|
||||
// updateInternalLoadBalancer is called when the list of nodes has changed. Therefore, only the instance groups
|
||||
// and possibly the backend service need to be updated.
|
||||
func (g *Cloud) updateInternalLoadBalancer(clusterName, clusterID string, svc *v1.Service, nodes []*v1.Node) error {
|
||||
if g.usesSubsets() {
|
||||
if g.AlphaFeatureGate.Enabled(AlphaFeatureILBSubsets) {
|
||||
return cloudprovider.ImplementedElsewhere
|
||||
}
|
||||
g.sharedResourceLock.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user