Skip to content
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

Exec should be easier to reuse as a command #11729

Merged
merged 1 commit into from
Jul 25, 2015

Conversation

smarterclayton
Copy link
Contributor

We have a few use cases where we want to have shortcut commands
for common behavior. In these cases, we want to default commands
with a simpler syntax, so being able to reuse Exec from code but
not share the same arguments is useful.

In this case, we're introducing 'rsh' which tries to run exec -itp --
bash.

@ncdc / @deads2k

@k8s-bot
Copy link

k8s-bot commented Jul 23, 2015

GCE e2e build/test passed for commit eb05fb97ab3e12bf59c637cfae2c65c4674c8c61.

@k8s-bot
Copy link

k8s-bot commented Jul 23, 2015

GCE e2e build/test passed for commit af1fac435bfca656b57be47633ed1ba594efbba3.

Err io.Writer

Executor RemoteExecutor
Client *client.Client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which interface do you actually need?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several, and we don't have an interface for rest client in client today
(just in resource). Future feature.

On Jul 23, 2015, at 7:37 AM, David Eads notifications@github.com wrote:

In pkg/kubectl/cmd/exec.go
#11729 (comment)
:

  • tty bool
    +// ExecOptions declare the arguments accepted by the Exec command
    +type ExecOptions struct {
  • Namespace string
  • PodName string
  • ContainerName string
  • Stdin bool
  • TTY bool
  • Args []string
    +
  • In io.Reader
  • Out io.Writer
  • Err io.Writer
    +
  • Executor RemoteExecutor
  • Client *client.Client

Which interface do you actually need?


Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/11729/files#r35312477
.

@deads2k
Copy link
Contributor

deads2k commented Jul 23, 2015

Minor comments. Big improvement.

@smarterclayton
Copy link
Contributor Author

Will have something soon.

On Jul 23, 2015, at 7:50 AM, David Eads notifications@github.com wrote:

Minor comments. Big improvement.


Reply to this email directly or view it on GitHub
#11729 (comment)
.

@vishh
Copy link
Contributor

vishh commented Jul 23, 2015

cc @bgrant0607

@smarterclayton
Copy link
Contributor Author

Comments addressed

On Thu, Jul 23, 2015 at 2:20 PM, Vish Kannan notifications@github.com
wrote:

cc @bgrant0607 https://github.com/bgrant0607


Reply to this email directly or view it on GitHub
#11729 (comment)
.

Clayton Coleman | Lead Engineer, OpenShift

if len(argsIn) < 1 {
return "", "", nil, cmdutil.UsageError(cmd, "COMMAND is required for exec")
return cmdutil.UsageError(cmd, "COMMAND is required for exec")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like validation best left to Validate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double validates because this is specific to command behavior (Complete)
not usage behavior (Validate)

On Thu, Jul 23, 2015 at 3:43 PM, David Eads notifications@github.com
wrote:

In pkg/kubectl/cmd/exec.go
#11729 (comment)
:

    if len(argsIn) < 1 {
  •       return "", "", nil, cmdutil.UsageError(cmd, "COMMAND is required for exec")
    
  •       return cmdutil.UsageError(cmd, "COMMAND is required for exec")
    

seems like validation best left to Validate


Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/11729/files#r35362768
.

Clayton Coleman | Lead Engineer, OpenShift

@deads2k
Copy link
Contributor

deads2k commented Jul 23, 2015

Just aesthetic disagreements.

lgtm.

@k8s-bot
Copy link

k8s-bot commented Jul 23, 2015

GCE e2e build/test failed for commit a40bdafa12a1c62e6ed13066edd5ef5c37ef1396.

@smarterclayton
Copy link
Contributor Author

ok to test

@bgrant0607
Copy link
Member

I support refactoring all commands for use as libraries: #7311.

@k8s-bot
Copy link

k8s-bot commented Jul 24, 2015

GCE e2e build/test passed for commit a40bdafa12a1c62e6ed13066edd5ef5c37ef1396.

@smarterclayton
Copy link
Contributor Author

I think this is ready for merge unless there are more comments?

@bgrant0607
Copy link
Member

Feel free to put the lgtm label on so that oncall will merge.

@ncdc
Copy link
Member

ncdc commented Jul 24, 2015

LGTM

On Fri, Jul 24, 2015 at 12:15 PM, Brian Grant notifications@github.com
wrote:

Feel free to put the lgtm label on so that oncall will merge.


Reply to this email directly or view it on GitHub
#11729 (comment)
.

@bgrant0607 bgrant0607 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 24, 2015
@bgrant0607
Copy link
Member

I meant github label. I just tagged it.

@bgrant0607 bgrant0607 closed this Jul 24, 2015
@bgrant0607 bgrant0607 reopened this Jul 24, 2015
@ncdc
Copy link
Member

ncdc commented Jul 24, 2015

I know - that was more for Clayton since he asked if there were any other
comments. :-)
On Fri, Jul 24, 2015 at 12:30 PM Brian Grant notifications@github.com
wrote:

Reopened #11729
#11729.


Reply to this email directly or view it on GitHub
#11729 (comment)
.

@mikedanese
Copy link
Member

@smarterclayton please rebase to fix shippable

We have a few use cases where we want to have shortcut commands
for common behavior. In these cases, we want to default commands
with a simpler syntax, so being able to reuse Exec from code but
not share the same arguments is useful.

In this case, we're introducing 'rsh' which tries to run exec -itp --
bash.
@k8s-bot
Copy link

k8s-bot commented Jul 24, 2015

GCE e2e build/test passed for commit 0b5410f.

mikedanese added a commit that referenced this pull request Jul 25, 2015
Exec should be easier to reuse as a command
@mikedanese mikedanese merged commit cfe41dc into kubernetes:master Jul 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants