Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in pkg/network #16793

Merged
merged 1 commit into from Oct 12, 2017

Conversation

pravisankar
Copy link

No description provided.

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 10, 2017
@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 10, 2017
@pravisankar
Copy link
Author

@openshift/networking PTAL

@@ -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"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this should not be camelCase?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes (refer https://github.com/openshift/origin/blob/master/pkg/network/apis/network/v1/types.go)
Even though camel case is the general norm, we incorrectly published the field name as 'hostsubnetlength', so this error should refer to the same name.
Anyway this field under ClusterNetwork is deprecated and the new HostSubnetLength under ClusterNetworkEntry is using camel case notation.

@@ -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.Warningf("Cluster contains objects incompatible with new ClusterNetwork: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had made this a log.Error intentionally to make it more likely to get noticed in the logs. (You can remove the "WARNING" if you want, but I think this should stay as log.Error.)

@@ -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 excludes existing objects: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"excludes" should be "exclude" there...

@@ -148,7 +148,7 @@ func (np *networkPolicyPlugin) AddNetNamespace(netns *networkapi.NetNamespace) {
defer np.lock.Unlock()

if _, exists := np.namespaces[netns.NetID]; exists {
glog.Warning("Got AddNetNamespace for already-existing namespace %s (%d)", netns.NetName, netns.NetID)
glog.Warningf("Got AddNetNamespace for already-existing namespace %s (%d)", netns.NetName, netns.NetID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't govet supposed to catch those?
...
OK, apparently, no, it looks for Logf, Errorf, and Fatalf, but not Warningf. We need to pass an argument. I'll file a bug about that.

@pravisankar
Copy link
Author

@danwinship updated, ptal

@danwinship
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 11, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship, pravisankar

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@imcsk8
Copy link
Contributor

imcsk8 commented Oct 12, 2017

LGTM

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 15807, 16778, 16801, 16804, 16793).

@openshift-merge-robot openshift-merge-robot merged commit 92559b7 into openshift:master Oct 12, 2017
openshift-merge-robot added a commit that referenced this pull request Oct 12, 2017
Automatic merge from submit-queue (batch tested with PRs 15807, 16778, 16801, 16804, 16793).

Make govet check glog.Info/Warning calls

The default set of names covered by govet's checking of Printf-like functions includes Log, Error, and Fatal, but not Info or Warning. (Noticed in #16793.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/networking lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants