summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-16 07:53:43 -0400
committerGitHub <noreply@github.com>2021-07-16 07:53:43 -0400
commitce28dc3c4c3dba468ddb6f2a249c0c4bfc058805 (patch)
tree0f16371ff56a8323db480d010b0315e600c2a50b /cmd
parent3ba9f2a205787135b4e34e4d217df3ab9d0071b8 (diff)
parentaf40dfc2bf614aeb4191916cc2420068696eb776 (diff)
downloadpodman-ce28dc3c4c3dba468ddb6f2a249c0c4bfc058805.tar.gz
podman-ce28dc3c4c3dba468ddb6f2a249c0c4bfc058805.tar.bz2
podman-ce28dc3c4c3dba468ddb6f2a249c0c4bfc058805.zip
Merge pull request #10820 from jvanz/indfra-container-name-issue-10794
--infra-name command line argument
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/pods/create.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index 0d299bb9c..abc47164b 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -86,6 +86,10 @@ func init() {
flags.String(infraCommandFlagName, containerConfig.Engine.InfraCommand, "The command to run on the infra container when the pod is started")
_ = createCommand.RegisterFlagCompletionFunc(infraCommandFlagName, completion.AutocompleteNone)
+ infraNameFlagName := "infra-name"
+ flags.StringVarP(&createOptions.InfraName, infraNameFlagName, "", "", "The name used as infra container name")
+ _ = createCommand.RegisterFlagCompletionFunc(infraNameFlagName, completion.AutocompleteNone)
+
labelFileFlagName := "label-file"
flags.StringSliceVar(&labelFile, labelFileFlagName, []string{}, "Read in a line delimited file of labels")
_ = createCommand.RegisterFlagCompletionFunc(labelFileFlagName, completion.AutocompleteDefault)
@@ -148,6 +152,9 @@ func create(cmd *cobra.Command, args []string) error {
return errors.New("cannot set infra-image without an infra container")
}
createOptions.InfraImage = ""
+ if createOptions.InfraName != "" {
+ return errors.New("cannot set infra-name without an infra container")
+ }
if cmd.Flag("share").Changed && share != "none" && share != "" {
return fmt.Errorf("cannot set share(%s) namespaces without an infra container", cmd.Flag("share").Value)