From 9607edc5561277c04a60cd8e12fdf1e28f6915d7 Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Tue, 7 Feb 2017 22:52:35 +0800 Subject: [PATCH] Clean up for some typo. 1) Removed a space in portforward.go. 2) Renamed `lockAquisitionFunc` to `lockAcquisitionFunc` in controller.go. 3) Fixed typo in predicates.go. --- pkg/kubectl/cmd/portforward.go | 2 +- plugin/pkg/admission/resourcequota/controller.go | 14 +++++++------- .../scheduler/algorithm/predicates/predicates.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/kubectl/cmd/portforward.go b/pkg/kubectl/cmd/portforward.go index c2ff18c9cc..3a5ae005ee 100644 --- a/pkg/kubectl/cmd/portforward.go +++ b/pkg/kubectl/cmd/portforward.go @@ -60,7 +60,7 @@ var ( kubectl port-forward mypod :5000 # Listen on a random port locally, forwarding to 5000 in the pod - kubectl port-forward mypod 0:5000`) + kubectl port-forward mypod 0:5000`) ) func NewCmdPortForward(f cmdutil.Factory, cmdOut, cmdErr io.Writer) *cobra.Command { diff --git a/plugin/pkg/admission/resourcequota/controller.go b/plugin/pkg/admission/resourcequota/controller.go index c41d627475..5fc9ab9a20 100644 --- a/plugin/pkg/admission/resourcequota/controller.go +++ b/plugin/pkg/admission/resourcequota/controller.go @@ -45,8 +45,8 @@ type Evaluator interface { type quotaEvaluator struct { quotaAccessor QuotaAccessor - // lockAquisitionFunc acquires any required locks and returns a cleanup method to defer - lockAquisitionFunc func([]api.ResourceQuota) func() + // lockAcquisitionFunc acquires any required locks and returns a cleanup method to defer + lockAcquisitionFunc func([]api.ResourceQuota) func() // registry that knows how to measure usage for objects registry quota.Registry @@ -99,10 +99,10 @@ func newAdmissionWaiter(a admission.Attributes) *admissionWaiter { // NewQuotaEvaluator configures an admission controller that can enforce quota constraints // using the provided registry. The registry must have the capability to handle group/kinds that // are persisted by the server this admission controller is intercepting -func NewQuotaEvaluator(quotaAccessor QuotaAccessor, registry quota.Registry, lockAquisitionFunc func([]api.ResourceQuota) func(), workers int, stopCh <-chan struct{}) Evaluator { +func NewQuotaEvaluator(quotaAccessor QuotaAccessor, registry quota.Registry, lockAcquisitionFunc func([]api.ResourceQuota) func(), workers int, stopCh <-chan struct{}) Evaluator { return "aEvaluator{ - quotaAccessor: quotaAccessor, - lockAquisitionFunc: lockAquisitionFunc, + quotaAccessor: quotaAccessor, + lockAcquisitionFunc: lockAcquisitionFunc, registry: registry, @@ -173,8 +173,8 @@ func (e *quotaEvaluator) checkAttributes(ns string, admissionAttributes []*admis return } - if e.lockAquisitionFunc != nil { - releaseLocks := e.lockAquisitionFunc(quotas) + if e.lockAcquisitionFunc != nil { + releaseLocks := e.lockAcquisitionFunc(quotas) defer releaseLocks() } diff --git a/plugin/pkg/scheduler/algorithm/predicates/predicates.go b/plugin/pkg/scheduler/algorithm/predicates/predicates.go index 00ad5a788c..28eee3e597 100644 --- a/plugin/pkg/scheduler/algorithm/predicates/predicates.go +++ b/plugin/pkg/scheduler/algorithm/predicates/predicates.go @@ -692,7 +692,7 @@ type ServiceAffinity struct { // only should be referenced by NewServiceAffinityPredicate. func (s *ServiceAffinity) serviceAffinityPrecomputation(pm *predicateMetadata) { if pm.pod == nil { - glog.Errorf("Cannot precompute service affinity, a pod is required to caluculate service affinity.") + glog.Errorf("Cannot precompute service affinity, a pod is required to calculate service affinity.") return }