-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
Podex handling multiple images #1898
Conversation
@@ -40,10 +40,11 @@ import ( | |||
"gopkg.in/v1/yaml" | |||
) | |||
|
|||
const usage = "usage: podex [-json|-yaml] <repo/dockerimage>" | |||
const usage = "usage: podex [-json|-yaml] -podID=ID <repo/dockerimage1> ... <repo/dockerimageN>" |
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 about -id
should be obvious since the output is a pod configuration..
Just some nits, thanks a lot for doing this :) |
@proppy thanks for review. Updated and rebased the PR :) |
if *podName == "" { | ||
if flag.NArg() > 1 { | ||
log.Fatal(usage) | ||
} else { |
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.
you can remove the else, since the log is fatal.
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.
yep, sorry for that
9ded97a
to
4f5331e
Compare
@proppy rebased, sorry for that :) |
@@ -120,3 +128,14 @@ func main() { | |||
os.Stdout.Write(bs) | |||
} | |||
} | |||
|
|||
// Function takes images name which is parsed. |
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.
parseDockerImage split a docker image name of the form
[REGISTRYHOST/][USERNAME/]NAME[:TAG]
We should probably add a TODO to handle the TAG
@@ -40,10 +40,11 @@ import ( | |||
"gopkg.in/v1/yaml" | |||
) | |||
|
|||
const usage = "usage: podex [-json|-yaml] <repo/dockerimage>" | |||
const usage = "usage: podex [-json|-yaml] -id=ID <repo/dockerimage1> ... <repo/dockerimageN>" |
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 think this should be: username/image1
username/image2
, I think repo
refers to username/image
LGTM just some docstring nits |
@proppy rebased |
Merged thanks. |
[release-4.14] OCPBUGS-29924: UPSTREAM: <carry>: openshift-kube-apiserver: add kube-apiserver patches
Podex can now handle multiple images.
Also adding
podID
flag, with which user can specify the pod ID.eg:
podex -json -podID=nodejs dockerfile/redis google/nodejs-hello
In case the command will take only one image the
podID
is optional and image base-name will be used for as a podID