mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
fix: formating and typo
This commit is contained in:
parent
d7f14fb38e
commit
fbe3521e8e
@ -283,7 +283,7 @@ func (az *Cloud) getLoadBalancerRuleName(service *v1.Service, protocol v1.Protoc
|
|||||||
return ruleName
|
return ruleName
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load balancer rule name must be less or equal to 80 charactors, so excluding the hyphen two segments cannot exceed 79
|
// Load balancer rule name must be less or equal to 80 characters, so excluding the hyphen two segments cannot exceed 79
|
||||||
subnetSegment := *subnet
|
subnetSegment := *subnet
|
||||||
if len(ruleName)+len(subnetSegment)+1 > loadBalancerRuleNameMaxLength {
|
if len(ruleName)+len(subnetSegment)+1 > loadBalancerRuleNameMaxLength {
|
||||||
subnetSegment = subnetSegment[:loadBalancerRuleNameMaxLength-len(ruleName)-1]
|
subnetSegment = subnetSegment[:loadBalancerRuleNameMaxLength-len(ruleName)-1]
|
||||||
@ -333,7 +333,7 @@ func (az *Cloud) getFrontendIPConfigName(service *v1.Service) string {
|
|||||||
if subnetName != nil {
|
if subnetName != nil {
|
||||||
ipcName := fmt.Sprintf("%s-%s", baseName, *subnetName)
|
ipcName := fmt.Sprintf("%s-%s", baseName, *subnetName)
|
||||||
|
|
||||||
// Azure lb front end configuration name must not exceed 80 charactors
|
// Azure lb front end configuration name must not exceed 80 characters
|
||||||
if len(ipcName) > frontendIPConfigNameMaxLength {
|
if len(ipcName) > frontendIPConfigNameMaxLength {
|
||||||
ipcName = ipcName[:frontendIPConfigNameMaxLength]
|
ipcName = ipcName[:frontendIPConfigNameMaxLength]
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,8 @@ limitations under the License.
|
|||||||
package azure
|
package azure
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ func TestGetLoadBalancingRuleName(t *testing.T) {
|
|||||||
expected: "a257b965551374ad2b091ef3f07043ad-shortsubnet-TCP-9000",
|
expected: "a257b965551374ad2b091ef3f07043ad-shortsubnet-TCP-9000",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "internal standard lb should have subnet name on the rule name but truncated to 80 charactors",
|
description: "internal standard lb should have subnet name on the rule name but truncated to 80 characters",
|
||||||
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
||||||
isInternal: true,
|
isInternal: true,
|
||||||
useStandardLB: true,
|
useStandardLB: true,
|
||||||
@ -294,7 +294,7 @@ func TestGetLoadBalancingRuleName(t *testing.T) {
|
|||||||
expected: "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnngg-TCP-9000",
|
expected: "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnngg-TCP-9000",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "internal basic lb should have subnet name on the rule name but truncated to 80 charactors",
|
description: "internal basic lb should have subnet name on the rule name but truncated to 80 characters",
|
||||||
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
||||||
isInternal: true,
|
isInternal: true,
|
||||||
useStandardLB: false,
|
useStandardLB: false,
|
||||||
@ -365,14 +365,14 @@ func TestGetFrontendIPConfigName(t *testing.T) {
|
|||||||
expected: "a257b965551374ad2b091ef3f07043ad-shortsubnet",
|
expected: "a257b965551374ad2b091ef3f07043ad-shortsubnet",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "internal standard lb should have subnet name on the frontend ip configuration name but truncated to 80 charactors",
|
description: "internal standard lb should have subnet name on the frontend ip configuration name but truncated to 80 characters",
|
||||||
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
||||||
isInternal: true,
|
isInternal: true,
|
||||||
useStandardLB: true,
|
useStandardLB: true,
|
||||||
expected: "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnnggggggggggg",
|
expected: "a257b965551374ad2b091ef3f07043ad-averylonnnngggnnnnnnnnnnnnnnnnnnnnnnggggggggggg",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "internal basic lb should have subnet name on the frontend ip configuration name but truncated to 80 charactors",
|
description: "internal basic lb should have subnet name on the frontend ip configuration name but truncated to 80 characters",
|
||||||
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
subnetName: "averylonnnngggnnnnnnnnnnnnnnnnnnnnnngggggggggggggggggggggggggggggggggggggsubet",
|
||||||
isInternal: true,
|
isInternal: true,
|
||||||
useStandardLB: false,
|
useStandardLB: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user