-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add --quiet to hide the 'waiting for pods to be running' message in kubectl run #28801
Add --quiet to hide the 'waiting for pods to be running' message in kubectl run #28801
Conversation
@@ -117,9 +117,11 @@ func addRunFlags(cmd *cobra.Command) { | |||
cmd.Flags().Bool("expose", false, "If true, a public, external service is created for the container(s) which are run") | |||
cmd.Flags().String("service-generator", "service/v2", "The name of the generator to use for creating a service. Only used if --expose is true") | |||
cmd.Flags().String("service-overrides", "", "An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.") | |||
cmd.Flags().Bool("silent", false, "If true, hide the 'waiting for pod to be running' message") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about making this a top-level flag? It's a common use case to run a command and ignore output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean we make it a global flag?
What'd other messages to be hidden? Something like when kubectl delete pod/foo --silent
we don't print pod "foo" deleted
but only print error messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What'd other messages to be hidden? Something like when kubectl delete pod/foo --silent we don't print pod "foo" deleted but only print error messages?
Yep, only print error messages. When passing --silent
you would rely on the return code to determine whether command succeeded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should get this in one place first and then come back later and
make it global. I'd like us to refactor the PrinterCommand stuff because
it's not aligned with how we do option structs (ideally we'd create an
option struct that we invoke bind on for the default printer options, and
hide retrieving the printer logic from commands).
On Mon, Jul 11, 2016 at 6:35 PM, Jeff Lowdermilk notifications@github.com
wrote:
In pkg/kubectl/cmd/run.go
#28801 (comment)
:@@ -117,9 +117,11 @@ func addRunFlags(cmd *cobra.Command) {
cmd.Flags().Bool("expose", false, "If true, a public, external service is created for the container(s) which are run")
cmd.Flags().String("service-generator", "service/v2", "The name of the generator to use for creating a service. Only used if --expose is true")
cmd.Flags().String("service-overrides", "", "An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.")
- cmd.Flags().Bool("silent", false, "If true, hide the 'waiting for pod to be running' message")
What'd other messages to be hidden? Something like when kubectl delete
pod/foo --silent we don't print pod "foo" deleted but only print error
messages?Yep, only print error messages. When passing --silent you would rely on
the return code to determine whether command succeeded.—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/kubernetes/pull/28801/files/deb67df071895d8eb9e41a1ac8c3d46c7fcef768#r70349834,
or mute the thread
https://github.com/notifications/unsubscribe/ABG_px5dVODgN287dOhxlfU8Z9Ey7BUoks5qUsUwgaJpZM4JJz6B
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help text says this hides the waiting for pods running
output. Is there other output from the command? It would be more intuitive if --silent
hid all output except errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this normally "quiet"? I'm trying to search man on my system for a
rough count of either, but it's taking too long.
On Mon, Jul 11, 2016 at 6:43 PM, Clayton Coleman ccoleman@redhat.com
wrote:
Maybe we should get this in one place first and then come back later and
make it global. I'd like us to refactor the PrinterCommand stuff because
it's not aligned with how we do option structs (ideally we'd create an
option struct that we invoke bind on for the default printer options, and
hide retrieving the printer logic from commands).On Mon, Jul 11, 2016 at 6:35 PM, Jeff Lowdermilk <notifications@github.com
wrote:
In pkg/kubectl/cmd/run.go
#28801 (comment)
:@@ -117,9 +117,11 @@ func addRunFlags(cmd *cobra.Command) {
cmd.Flags().Bool("expose", false, "If true, a public, external service is created for the container(s) which are run")
cmd.Flags().String("service-generator", "service/v2", "The name of the generator to use for creating a service. Only used if --expose is true")
cmd.Flags().String("service-overrides", "", "An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.")
- cmd.Flags().Bool("silent", false, "If true, hide the 'waiting for pod to be running' message")
What'd other messages to be hidden? Something like when kubectl delete
pod/foo --silent we don't print pod "foo" deleted but only print error
messages?Yep, only print error messages. When passing --silent you would rely on
the return code to determine whether command succeeded.—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/kubernetes/pull/28801/files/deb67df071895d8eb9e41a1ac8c3d46c7fcef768#r70349834,
or mute the thread
https://github.com/notifications/unsubscribe/ABG_px5dVODgN287dOhxlfU8Z9Ey7BUoks5qUsUwgaJpZM4JJz6B
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would worry that "--silent" here might be interpreted to mean "show no
log output, only return an exit code if you can get the pod"
On Mon, Jul 11, 2016 at 6:49 PM, Clayton Coleman ccoleman@redhat.com
wrote:
Isn't this normally "quiet"? I'm trying to search man on my system for a
rough count of either, but it's taking too long.On Mon, Jul 11, 2016 at 6:43 PM, Clayton Coleman ccoleman@redhat.com
wrote:Maybe we should get this in one place first and then come back later and
make it global. I'd like us to refactor the PrinterCommand stuff because
it's not aligned with how we do option structs (ideally we'd create an
option struct that we invoke bind on for the default printer options, and
hide retrieving the printer logic from commands).On Mon, Jul 11, 2016 at 6:35 PM, Jeff Lowdermilk <
notifications@github.com> wrote:In pkg/kubectl/cmd/run.go
#28801 (comment)
:@@ -117,9 +117,11 @@ func addRunFlags(cmd *cobra.Command) {
cmd.Flags().Bool("expose", false, "If true, a public, external service is created for the container(s) which are run")
cmd.Flags().String("service-generator", "service/v2", "The name of the generator to use for creating a service. Only used if --expose is true")
cmd.Flags().String("service-overrides", "", "An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.")
- cmd.Flags().Bool("silent", false, "If true, hide the 'waiting for pod to be running' message")
What'd other messages to be hidden? Something like when kubectl delete
pod/foo --silent we don't print pod "foo" deleted but only print error
messages?Yep, only print error messages. When passing --silent you would rely on
the return code to determine whether command succeeded.—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/kubernetes/pull/28801/files/deb67df071895d8eb9e41a1ac8c3d46c7fcef768#r70349834,
or mute the thread
https://github.com/notifications/unsubscribe/ABG_px5dVODgN287dOhxlfU8Z9Ey7BUoks5qUsUwgaJpZM4JJz6B
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarterclayton Agreed. Since it'd still generate some "sound", --quiet
would make more sense.
deb67df
to
7012fa4
Compare
PTAL |
@@ -117,9 +117,11 @@ func addRunFlags(cmd *cobra.Command) { | |||
cmd.Flags().Bool("expose", false, "If true, a public, external service is created for the container(s) which are run") | |||
cmd.Flags().String("service-generator", "service/v2", "The name of the generator to use for creating a service. Only used if --expose is true") | |||
cmd.Flags().String("service-overrides", "", "An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.") | |||
cmd.Flags().Bool("quiet", false, "If true, hide the 'waiting for pod to be running' message") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future proofing, maybe say "only print output from the running pods" or similar?
7012fa4
to
268b93e
Compare
@@ -117,9 +117,11 @@ func addRunFlags(cmd *cobra.Command) { | |||
cmd.Flags().Bool("expose", false, "If true, a public, external service is created for the container(s) which are run") | |||
cmd.Flags().String("service-generator", "service/v2", "The name of the generator to use for creating a service. Only used if --expose is true") | |||
cmd.Flags().String("service-overrides", "", "An inline JSON override for the generated service object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. Only used if --expose is true.") | |||
cmd.Flags().Bool("quiet", false, "If true, suppress prompt messages.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the usage of --quiet
to If true, suppress prompt messages.
GCE e2e build/test passed for commit 268b93e. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 268b93e. |
Automatic merge from submit-queue |
Ref #28695
@kubernetes/kubectl