From 4b8437b9cf99cbf90952a770cff6cdb8e8d87cf5 Mon Sep 17 00:00:00 2001 From: John Harris Date: Tue, 9 Jul 2019 19:13:14 -0700 Subject: [PATCH] Fix 'concurrency' logs typo Signed-off-by: John Harris --- pkg/kubectl/cmd/logs/logs.go | 18 +++++++++--------- pkg/kubectl/cmd/logs/logs_test.go | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/kubectl/cmd/logs/logs.go b/pkg/kubectl/cmd/logs/logs.go index 6a2f9c6631c..5ecc8c276b9 100644 --- a/pkg/kubectl/cmd/logs/logs.go +++ b/pkg/kubectl/cmd/logs/logs.go @@ -107,7 +107,7 @@ type LogsOptions struct { // whether or not a container name was given via --container ContainerNameSpecified bool Selector string - MaxFollowConcurency int + MaxFollowConcurrency int Object runtime.Object GetPodTimeout time.Duration @@ -121,10 +121,10 @@ type LogsOptions struct { func NewLogsOptions(streams genericclioptions.IOStreams, allContainers bool) *LogsOptions { return &LogsOptions{ - IOStreams: streams, - AllContainers: allContainers, - Tail: -1, - MaxFollowConcurency: 5, + IOStreams: streams, + AllContainers: allContainers, + Tail: -1, + MaxFollowConcurrency: 5, } } @@ -162,7 +162,7 @@ func NewCmdLogs(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C cmd.Flags().StringVarP(&o.Container, "container", "c", o.Container, "Print the logs of this container") cmdutil.AddPodRunningTimeoutFlag(cmd, defaultPodLogsTimeout) cmd.Flags().StringVarP(&o.Selector, "selector", "l", o.Selector, "Selector (label query) to filter on.") - cmd.Flags().IntVar(&o.MaxFollowConcurency, "max-log-requests", o.MaxFollowConcurency, "Specify maximum number of concurrent logs to follow when using by a selector. Defaults to 5.") + cmd.Flags().IntVar(&o.MaxFollowConcurrency, "max-log-requests", o.MaxFollowConcurrency, "Specify maximum number of concurrent logs to follow when using by a selector. Defaults to 5.") return cmd } @@ -308,10 +308,10 @@ func (o LogsOptions) RunLogs() error { } if o.Follow && len(requests) > 1 { - if len(requests) > o.MaxFollowConcurency { + if len(requests) > o.MaxFollowConcurrency { return fmt.Errorf( - "you are attempting to follow %d log streams, but maximum allowed concurency is %d, use --max-log-requests to increase the limit", - len(requests), o.MaxFollowConcurency, + "you are attempting to follow %d log streams, but maximum allowed concurrency is %d, use --max-log-requests to increase the limit", + len(requests), o.MaxFollowConcurrency, ) } diff --git a/pkg/kubectl/cmd/logs/logs_test.go b/pkg/kubectl/cmd/logs/logs_test.go index e2b9da41b15..2fd150bbcb4 100644 --- a/pkg/kubectl/cmd/logs/logs_test.go +++ b/pkg/kubectl/cmd/logs/logs_test.go @@ -108,7 +108,7 @@ func TestLog(t *testing.T) { }, }, { - name: "fail to follow logs from multiple requests when there are more logs sources then MaxFollowConcurency allows", + name: "fail to follow logs from multiple requests when there are more logs sources then MaxFollowConcurrency allows", opts: func(streams genericclioptions.IOStreams) *LogsOptions { wg := &sync.WaitGroup{} mock := &logTestMock{ @@ -124,11 +124,11 @@ func TestLog(t *testing.T) { o := NewLogsOptions(streams, false) o.LogsForObject = mock.mockLogsForObject o.ConsumeRequestFn = mock.mockConsumeRequest - o.MaxFollowConcurency = 2 + o.MaxFollowConcurrency = 2 o.Follow = true return o }, - expectedErr: "you are attempting to follow 3 log streams, but maximum allowed concurency is 2, use --max-log-requests to increase the limit", + expectedErr: "you are attempting to follow 3 log streams, but maximum allowed concurrency is 2, use --max-log-requests to increase the limit", }, { name: "fail if LogsForObject fails",