Skip to content

Commit

Permalink
Merge pull request #16793 from pravisankar/misc-fixes
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 15807, 16778, 16801, 16804, 16793).

Fix typos in pkg/network
  • Loading branch information
openshift-merge-robot committed Oct 12, 2017
2 parents 4d026d0 + fe3314b commit 92559b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pkg/network/apis/network/validation/validation.go
Expand Up @@ -28,6 +28,7 @@ func ValidateClusterNetwork(clusterNet *networkapi.ClusterNetwork) field.ErrorLi
allErrs := validation.ValidateObjectMeta(&clusterNet.ObjectMeta, false, path.ValidatePathSegmentName, field.NewPath("metadata"))
var testedCIDRS []*net.IPNet

// This check is mainly for ensuring backward compatibility
if len(clusterNet.Network) != 0 || clusterNet.HostSubnetLength != 0 {
//In the case that a user manually makes a clusterNetwork object with clusterNet.Network and clusterNet.HostubnetLength at least make sure they are valid values
clusterIPNet, err := netutils.ParseCIDRMask(clusterNet.Network)
Expand All @@ -36,9 +37,9 @@ func ValidateClusterNetwork(clusterNet *networkapi.ClusterNetwork) field.ErrorLi
} else {
maskLen, addrLen := clusterIPNet.Mask.Size()
if clusterNet.HostSubnetLength > uint32(addrLen-maskLen) {
allErrs = append(allErrs, field.Invalid(field.NewPath("hostSubnetLength"), clusterNet.HostSubnetLength, "subnet length is too large for clusterNetwork"))
allErrs = append(allErrs, field.Invalid(field.NewPath("hostsubnetlength"), clusterNet.HostSubnetLength, "subnet length is too large for clusterNetwork"))
} else if clusterNet.HostSubnetLength < 2 {
allErrs = append(allErrs, field.Invalid(field.NewPath("hostSubnetLength"), clusterNet.HostSubnetLength, "subnet length must be at least 2"))
allErrs = append(allErrs, field.Invalid(field.NewPath("hostsubnetlength"), clusterNet.HostSubnetLength, "subnet length must be at least 2"))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/network/master/master.go
Expand Up @@ -94,7 +94,7 @@ func Start(networkConfig osconfigapi.MasterNetworkConfig, networkClient networkc
log.Infof("Created ClusterNetwork %s", common.ClusterNetworkToString(configCN))

if err = master.checkClusterNetworkAgainstClusterObjects(); err != nil {
log.Errorf("WARNING: cluster contains objects incompatible with new ClusterNetwork: %v", err)
log.Errorf("Cluster contains objects incompatible with new ClusterNetwork: %v", err)
}
} else {
configChanged, err := clusterNetworkChanged(configCN, existingCN)
Expand All @@ -105,7 +105,7 @@ func Start(networkConfig osconfigapi.MasterNetworkConfig, networkClient networkc
configCN.TypeMeta = existingCN.TypeMeta
configCN.ObjectMeta = existingCN.ObjectMeta
if err = master.checkClusterNetworkAgainstClusterObjects(); err != nil {
log.Errorf("ERROR: Attempting to modify cluster to excludes existing objects: %v", err)
log.Errorf("Attempting to modify cluster to exclude existing objects: %v", err)
return false, err
}
if _, err = master.networkClient.Network().ClusterNetworks().Update(configCN); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/master/subnets.go
Expand Up @@ -82,7 +82,7 @@ func (master *OsdnMaster) addNode(nodeName string, nodeIP string, hsAnnotations
}
}

// Create new subet
// Create new subnet
for _, possibleSubnet := range master.subnetAllocatorList {
sn, err := possibleSubnet.GetNetwork()
if err == netutils.ErrSubnetAllocatorFull {
Expand Down

0 comments on commit 92559b7

Please sign in to comment.