Fix 'concurrency' logs typo

Signed-off-by: John Harris <joharris@vmware.com>
This commit is contained in:
John Harris 2019-07-09 19:13:14 -07:00
parent d59a603f1b
commit 4b8437b9cf
2 changed files with 12 additions and 12 deletions

View File

@ -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,
)
}

View File

@ -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",