Skip to content

Commit

Permalink
Merge pull request kubernetes#34533 from yuexiao-wang/fix-commends
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Update function name for public function in commend

**What this PR does / why we need it**:
Update function name for public function in commend and fix some typos in log information.

Signed-off-by: yuexiao-wang [email protected]
  • Loading branch information
Kubernetes Submit Queue authored Jan 30, 2017
2 parents 3dbbd0b + 27f61cb commit 1b9f896
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/fieldpath/fieldpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error)
return accessor.GetNamespace(), nil
}

return "", fmt.Errorf("Unsupported fieldPath: %v", fieldPath)
return "", fmt.Errorf("unsupported fieldPath: %v", fieldPath)
}

// TODO: move the functions below to pkg/api/util/resources
Expand Down Expand Up @@ -146,7 +146,7 @@ func InternalExtractContainerResourceValue(fs *api.ResourceFieldSelector, contai
return convertResourceMemoryToString(container.Resources.Requests.Memory(), divisor)
}

return "", fmt.Errorf("Unsupported container resource : %v", fs.Resource)
return "", fmt.Errorf("unsupported container resource : %v", fs.Resource)
}

// findContainerInPod finds a container by its name in the provided pod
Expand All @@ -159,7 +159,7 @@ func findContainerInPod(pod *v1.Pod, containerName string) (*v1.Container, error
return nil, fmt.Errorf("container %s not found", containerName)
}

// convertResourceCPUTOString converts cpu value to the format of divisor and returns
// convertResourceCPUToString converts cpu value to the format of divisor and returns
// ceiling of the value.
func convertResourceCPUToString(cpu *resource.Quantity, divisor resource.Quantity) (string, error) {
c := int64(math.Ceil(float64(cpu.MilliValue()) / float64(divisor.MilliValue())))
Expand Down
6 changes: 3 additions & 3 deletions pkg/fieldpath/fieldpath_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestExtractFieldPathAsString(t *testing.T) {
Namespace: "object-namespace",
},
},
expectedMessageFragment: "Unsupported fieldPath",
expectedMessageFragment: "unsupported fieldPath",
},
}

Expand All @@ -109,13 +109,13 @@ func TestExtractFieldPathAsString(t *testing.T) {
if err != nil {
if tc.expectedMessageFragment != "" {
if !strings.Contains(err.Error(), tc.expectedMessageFragment) {
t.Errorf("%v: Unexpected error message: %q, expected to contain %q", tc.name, err, tc.expectedMessageFragment)
t.Errorf("%v: unexpected error message: %q, expected to contain %q", tc.name, err, tc.expectedMessageFragment)
}
} else {
t.Errorf("%v: unexpected error: %v", tc.name, err)
}
} else if e := tc.expectedValue; e != "" && e != actual {
t.Errorf("%v: Unexpected result; got %q, expected %q", tc.name, actual, e)
t.Errorf("%v: unexpected result; got %q, expected %q", tc.name, actual, e)
}
}
}
Expand Down

0 comments on commit 1b9f896

Please sign in to comment.