summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml14
-rw-r--r--cmd/podman/common/specgen.go18
-rw-r--r--cmd/podman/images/list.go18
-rw-r--r--cmd/podman/root.go10
-rw-r--r--cmd/podman/validate/args.go32
-rw-r--r--cmd/podman/validate/latest.go7
-rwxr-xr-xcontrib/cirrus/apiv2_test.sh2
-rwxr-xr-xcontrib/cirrus/build_release.sh4
-rwxr-xr-xcontrib/cirrus/check_image.sh2
-rw-r--r--contrib/cirrus/container_test.sh6
-rwxr-xr-xcontrib/cirrus/integration_test.sh2
-rw-r--r--contrib/cirrus/lib.sh4
-rwxr-xr-xcontrib/cirrus/logcollector.sh6
-rwxr-xr-xcontrib/cirrus/setup_environment.sh2
-rwxr-xr-xcontrib/cirrus/system_test.sh2
-rw-r--r--pkg/specgen/generate/oci.go4
-rw-r--r--test/e2e/run_test.go11
-rw-r--r--test/system/120-load.bats2
18 files changed, 72 insertions, 74 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index cd122d39f..1458e2cc6 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -59,7 +59,7 @@ env:
#### Default to NOT operating in any special-case testing mode
####
SPECIALMODE: "none" # don't do anything special
- TEST_REMOTE_CLIENT: 'false' # don't test remote client by default
+ RCLI: 'false' # don't test remote client by default
ADD_SECOND_PARTITION: 'false' # will certainly fail inside containers
MOD_CONTAINERS_CONF: 'true' # Update containers.conf runtime if required by OS environment
@@ -422,8 +422,8 @@ testing_task:
env:
ADD_SECOND_PARTITION: 'true'
matrix:
- - TEST_REMOTE_CLIENT: 'true'
- - TEST_REMOTE_CLIENT: 'false'
+ - RCLI: 'true'
+ - RCLI: 'false'
networking_script: '${CIRRUS_WORKING_DIR}/${SCRIPT_BASE}/networking.sh'
setup_environment_script: '$SCRIPT_BASE/setup_environment.sh |& ${TIMESTAMP}'
@@ -470,8 +470,8 @@ special_testing_rootless_task:
ADD_SECOND_PARTITION: 'true'
SPECIALMODE: 'rootless' # See docs
matrix:
- - TEST_REMOTE_CLIENT: 'true'
- - TEST_REMOTE_CLIENT: 'false'
+ - RCLI: 'true'
+ - RCLI: 'false'
timeout_in: 60m
@@ -674,8 +674,8 @@ verify_test_built_images_task:
env:
ADD_SECOND_PARTITION: 'true'
matrix:
- - TEST_REMOTE_CLIENT: 'true'
- - TEST_REMOTE_CLIENT: 'false'
+ - RCLI: 'true'
+ - RCLI: 'false'
matrix:
PACKER_BUILDER_NAME: "${FEDORA_NAME}"
PACKER_BUILDER_NAME: "${PRIOR_FEDORA_NAME}"
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 0b6897d3a..5c6c47e8d 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -387,8 +387,6 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
s.Annotations = annotations
s.WorkDir = c.Workdir
- userCommand := []string{}
- var command []string
if c.Entrypoint != nil {
entrypoint := []string{}
if ep := *c.Entrypoint; len(ep) > 0 {
@@ -398,27 +396,13 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
}
}
s.Entrypoint = entrypoint
- // Build the command
- // If we have an entry point, it goes first
- command = entrypoint
}
// Include the command used to create the container.
s.ContainerCreateCommand = os.Args
if len(inputCommand) > 0 {
- // User command overrides data CMD
- command = append(command, inputCommand...)
- userCommand = append(userCommand, inputCommand...)
- }
-
- switch {
- case len(inputCommand) > 0:
- s.Command = userCommand
- case c.Entrypoint != nil:
- s.Command = []string{}
- default:
- s.Command = command
+ s.Command = inputCommand
}
// SHM Size
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go
index ee0f64d99..043871a8c 100644
--- a/cmd/podman/images/list.go
+++ b/cmd/podman/images/list.go
@@ -195,6 +195,7 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) {
} else {
h.ImageSummary = *e
h.Repository = "<none>"
+ h.Tag = "<none>"
imgs = append(imgs, h)
}
listFlag.readOnly = e.IsReadOnly()
@@ -205,27 +206,34 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) {
}
func tokenRepoTag(ref string) (string, string, error) {
-
if ref == "<none>:<none>" {
return "<none>", "<none>", nil
}
repo, err := reference.Parse(ref)
if err != nil {
- return "", "", err
+ return "<none>", "<none>", err
}
named, ok := repo.(reference.Named)
if !ok {
- return ref, "", nil
+ return ref, "<none>", nil
+ }
+ name := named.Name()
+ if name == "" {
+ name = "<none>"
}
tagged, ok := repo.(reference.Tagged)
if !ok {
- return named.Name(), "", nil
+ return name, "<none>", nil
+ }
+ tag := tagged.Tag()
+ if tag == "" {
+ tag = "<none>"
}
- return named.Name(), tagged.Tag(), nil
+ return name, tag, nil
}
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 9e9011dc9..2aa7267c2 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -6,7 +6,6 @@ import (
"path"
"runtime"
"runtime/pprof"
- "strconv"
"strings"
"github.com/containers/common/pkg/config"
@@ -112,15 +111,6 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
cfg := registry.PodmanConfig()
- // Validate --remote and --latest not given on same command
- latest := cmd.Flags().Lookup("latest")
- if latest != nil {
- value, _ := strconv.ParseBool(latest.Value.String())
- if cfg.Remote && value {
- return errors.Errorf("For %s \"--remote\" and \"--latest\", are mutually exclusive flags", cmd.CommandPath())
- }
- }
-
// Prep the engines
if _, err := registry.NewImageEngine(cmd, args); err != nil {
return err
diff --git a/cmd/podman/validate/args.go b/cmd/podman/validate/args.go
index a33f47959..aacb41e69 100644
--- a/cmd/podman/validate/args.go
+++ b/cmd/podman/validate/args.go
@@ -4,6 +4,7 @@ import (
"fmt"
"strconv"
+ "github.com/containers/podman/v2/cmd/podman/registry"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
@@ -47,17 +48,20 @@ func IDOrLatestArgs(cmd *cobra.Command, args []string) error {
// CheckAllLatestAndCIDFile checks that --all and --latest are used correctly.
// If cidfile is set, also check for the --cidfile flag.
func CheckAllLatestAndCIDFile(c *cobra.Command, args []string, ignoreArgLen bool, cidfile bool) error {
+ var specifiedLatest bool
argLen := len(args)
- if c.Flags().Lookup("all") == nil || c.Flags().Lookup("latest") == nil {
- if !cidfile {
- return errors.New("unable to lookup values for 'latest' or 'all'")
- } else if c.Flags().Lookup("cidfile") == nil {
- return errors.New("unable to lookup values for 'latest', 'all' or 'cidfile'")
+ if !registry.IsRemote() {
+ specifiedLatest, _ = c.Flags().GetBool("latest")
+ if c.Flags().Lookup("all") == nil || c.Flags().Lookup("latest") == nil {
+ if !cidfile {
+ return errors.New("unable to lookup values for 'latest' or 'all'")
+ } else if c.Flags().Lookup("cidfile") == nil {
+ return errors.New("unable to lookup values for 'latest', 'all' or 'cidfile'")
+ }
}
}
specifiedAll, _ := c.Flags().GetBool("all")
- specifiedLatest, _ := c.Flags().GetBool("latest")
specifiedCIDFile := false
if cid, _ := c.Flags().GetStringArray("cidfile"); len(cid) > 0 {
specifiedCIDFile = true
@@ -98,17 +102,21 @@ func CheckAllLatestAndCIDFile(c *cobra.Command, args []string, ignoreArgLen bool
// CheckAllLatestAndPodIDFile checks that --all and --latest are used correctly.
// If withIDFile is set, also check for the --pod-id-file flag.
func CheckAllLatestAndPodIDFile(c *cobra.Command, args []string, ignoreArgLen bool, withIDFile bool) error {
+ var specifiedLatest bool
argLen := len(args)
- if c.Flags().Lookup("all") == nil || c.Flags().Lookup("latest") == nil {
- if !withIDFile {
- return errors.New("unable to lookup values for 'latest' or 'all'")
- } else if c.Flags().Lookup("pod-id-file") == nil {
- return errors.New("unable to lookup values for 'latest', 'all' or 'pod-id-file'")
+ if !registry.IsRemote() {
+ // remote clients have no latest flag
+ specifiedLatest, _ = c.Flags().GetBool("latest")
+ if c.Flags().Lookup("all") == nil || c.Flags().Lookup("latest") == nil {
+ if !withIDFile {
+ return errors.New("unable to lookup values for 'latest' or 'all'")
+ } else if c.Flags().Lookup("pod-id-file") == nil {
+ return errors.New("unable to lookup values for 'latest', 'all' or 'pod-id-file'")
+ }
}
}
specifiedAll, _ := c.Flags().GetBool("all")
- specifiedLatest, _ := c.Flags().GetBool("latest")
specifiedPodIDFile := false
if pid, _ := c.Flags().GetStringArray("pod-id-file"); len(pid) > 0 {
specifiedPodIDFile = true
diff --git a/cmd/podman/validate/latest.go b/cmd/podman/validate/latest.go
index 5c76fe847..c9bff798a 100644
--- a/cmd/podman/validate/latest.go
+++ b/cmd/podman/validate/latest.go
@@ -7,9 +7,8 @@ import (
func AddLatestFlag(cmd *cobra.Command, b *bool) {
// Initialization flag verification
- cmd.Flags().BoolVarP(b, "latest", "l", false,
- "Act on the latest container podman is aware of\nNot supported with the \"--remote\" flag")
- if registry.IsRemote() {
- _ = cmd.Flags().MarkHidden("latest")
+ if !registry.IsRemote() {
+ cmd.Flags().BoolVarP(b, "latest", "l", false,
+ "Act on the latest container podman is aware of\nNot supported with the \"--remote\" flag")
}
}
diff --git a/contrib/cirrus/apiv2_test.sh b/contrib/cirrus/apiv2_test.sh
index 33e9fbc6b..546fe8e30 100755
--- a/contrib/cirrus/apiv2_test.sh
+++ b/contrib/cirrus/apiv2_test.sh
@@ -7,7 +7,7 @@ source $(dirname $0)/lib.sh
req_env_var GOSRC SCRIPT_BASE OS_RELEASE_ID OS_RELEASE_VER CONTAINER_RUNTIME VARLINK_LOG
LOCAL_OR_REMOTE=local
-if [[ "$TEST_REMOTE_CLIENT" = "true" ]]; then
+if [[ "$RCLI" = "true" ]]; then
LOCAL_OR_REMOTE=remote
fi
diff --git a/contrib/cirrus/build_release.sh b/contrib/cirrus/build_release.sh
index 07db88f81..45634f368 100755
--- a/contrib/cirrus/build_release.sh
+++ b/contrib/cirrus/build_release.sh
@@ -4,11 +4,11 @@ set -e
source $(dirname $0)/lib.sh
-req_env_var TEST_REMOTE_CLIENT OS_RELEASE_ID GOSRC
+req_env_var RCLI OS_RELEASE_ID GOSRC
cd $GOSRC
-if [[ "$TEST_REMOTE_CLIENT" == "true" ]] && [[ -z "$CROSS_PLATFORM" ]]
+if [[ "$RCLI" == "true" ]] && [[ -z "$CROSS_PLATFORM" ]]
then
CROSS_PLATFORM=linux
fi
diff --git a/contrib/cirrus/check_image.sh b/contrib/cirrus/check_image.sh
index 39c2be3f8..13172fe1c 100755
--- a/contrib/cirrus/check_image.sh
+++ b/contrib/cirrus/check_image.sh
@@ -6,7 +6,7 @@ source $(dirname $0)/lib.sh
EVIL_UNITS="$($CIRRUS_WORKING_DIR/$PACKER_BASE/systemd_banish.sh --list)"
-req_env_var PACKER_BUILDER_NAME TEST_REMOTE_CLIENT EVIL_UNITS OS_RELEASE_ID CG_FS_TYPE
+req_env_var PACKER_BUILDER_NAME RCLI EVIL_UNITS OS_RELEASE_ID CG_FS_TYPE
NFAILS=0
echo "Validating VM image"
diff --git a/contrib/cirrus/container_test.sh b/contrib/cirrus/container_test.sh
index 8a4ed9492..b56a12232 100644
--- a/contrib/cirrus/container_test.sh
+++ b/contrib/cirrus/container_test.sh
@@ -18,7 +18,7 @@ if [ "${ID}" != "fedora" ] || [ "${CONTAINER_RUNTIME}" != "" ]; then
INTEGRATION_TEST_ENVS="SKIP_USERNS=1"
fi
-echo "$(date --rfc-3339=seconds) $(basename $0) started with '$*' and TEST_REMOTE_CLIENT='${TEST_REMOTE_CLIENT}'"
+echo "$(date --rfc-3339=seconds) $(basename $0) started with '$*' and RCLI='${RCLI}'"
pwd
@@ -57,9 +57,9 @@ while getopts "bituv" opt; do
esac
done
-# The TEST_REMOTE_CLIENT environment variable decides whether
+# The RCLI environment variable decides whether
# to test varlinke
-if [[ "$TEST_REMOTE_CLIENT" == "true" ]]; then
+if [[ "$RCLI" == "true" ]]; then
remote=1
fi
diff --git a/contrib/cirrus/integration_test.sh b/contrib/cirrus/integration_test.sh
index 692d5a236..c65f5e25f 100755
--- a/contrib/cirrus/integration_test.sh
+++ b/contrib/cirrus/integration_test.sh
@@ -7,7 +7,7 @@ source $(dirname $0)/lib.sh
req_env_var GOSRC SCRIPT_BASE OS_RELEASE_ID OS_RELEASE_VER CONTAINER_RUNTIME VARLINK_LOG
LOCAL_OR_REMOTE=local
-if [[ "$TEST_REMOTE_CLIENT" = "true" ]]; then
+if [[ "$RCLI" = "true" ]]; then
LOCAL_OR_REMOTE=remote
fi
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index d2af4d883..968b2de39 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -96,12 +96,12 @@ LILTO="timeout_attempt_delay_command 120s 5 30s"
BIGTO="timeout_attempt_delay_command 300s 5 60s"
# Safe env. vars. to transfer from root -> $ROOTLESS_USER (go env handled separately)
-ROOTLESS_ENV_RE='(CIRRUS_.+)|(ROOTLESS_.+)|(.+_IMAGE.*)|(.+_BASE)|(.*DIRPATH)|(.*FILEPATH)|(SOURCE.*)|(DEPEND.*)|(.+_DEPS_.+)|(OS_REL.*)|(.+_ENV_RE)|(TRAVIS)|(CI.+)|(TEST_REMOTE.*)'
+ROOTLESS_ENV_RE='(CIRRUS_.+)|(ROOTLESS_.+)|(.+_IMAGE.*)|(.+_BASE)|(.*DIRPATH)|(.*FILEPATH)|(SOURCE.*)|(DEPEND.*)|(.+_DEPS_.+)|(OS_REL.*)|(.+_ENV_RE)|(TRAVIS)|(CI.+)|(REMOTE.*)'
# Unsafe env. vars for display
SECRET_ENV_RE='(IRCID)|(ACCOUNT)|(GC[EP]..+)|(SSH)'
SPECIALMODE="${SPECIALMODE:-none}"
-TEST_REMOTE_CLIENT="${TEST_REMOTE_CLIENT:-false}"
+RCLI="${RCLI:-false}"
export CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-podman}
# When running as root, this may be empty or not, as a user, it MUST be set.
diff --git a/contrib/cirrus/logcollector.sh b/contrib/cirrus/logcollector.sh
index 0b179591a..859da2966 100755
--- a/contrib/cirrus/logcollector.sh
+++ b/contrib/cirrus/logcollector.sh
@@ -4,7 +4,7 @@ set -e
source $(dirname $0)/lib.sh
-req_env_var CIRRUS_WORKING_DIR OS_RELEASE_ID TEST_REMOTE_CLIENT
+req_env_var CIRRUS_WORKING_DIR OS_RELEASE_ID RCLI
# Assume there are other log collection commands to follow - Don't
# let one break another that may be useful, but also keep any
@@ -34,12 +34,12 @@ case $1 in
journal) showrun journalctl -b ;;
podman) showrun ./bin/podman system info ;;
varlink)
- if [[ "$TEST_REMOTE_CLIENT" == "true" ]]
+ if [[ "$RCLI" == "true" ]]
then
echo "(Trailing 100 lines of $VARLINK_LOG)"
showrun tail -100 $VARLINK_LOG
else
- die 0 "\$TEST_REMOTE_CLIENT is not 'true': $TEST_REMOTE_CLIENT"
+ die 0 "\$RCLI is not 'true': $RCLI"
fi
;;
packages)
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh
index 94169442b..0b9d686d3 100755
--- a/contrib/cirrus/setup_environment.sh
+++ b/contrib/cirrus/setup_environment.sh
@@ -103,7 +103,7 @@ case "$SPECIALMODE" in
tee -a /etc/environment) && eval "$X" && echo "$X"
X=$(echo "export SPECIALMODE='${SPECIALMODE}'" | \
tee -a /etc/environment) && eval "$X" && echo "$X"
- X=$(echo "export TEST_REMOTE_CLIENT='${TEST_REMOTE_CLIENT}'" | \
+ X=$(echo "export RCLI='${RCLI}'" | \
tee -a /etc/environment) && eval "$X" && echo "$X"
setup_rootless
fi
diff --git a/contrib/cirrus/system_test.sh b/contrib/cirrus/system_test.sh
index 33e9fbc6b..546fe8e30 100755
--- a/contrib/cirrus/system_test.sh
+++ b/contrib/cirrus/system_test.sh
@@ -7,7 +7,7 @@ source $(dirname $0)/lib.sh
req_env_var GOSRC SCRIPT_BASE OS_RELEASE_ID OS_RELEASE_VER CONTAINER_RUNTIME VARLINK_LOG
LOCAL_OR_REMOTE=local
-if [[ "$TEST_REMOTE_CLIENT" = "true" ]]; then
+if [[ "$RCLI" = "true" ]]; then
LOCAL_OR_REMOTE=remote
fi
diff --git a/pkg/specgen/generate/oci.go b/pkg/specgen/generate/oci.go
index 78cd32253..ee9f63680 100644
--- a/pkg/specgen/generate/oci.go
+++ b/pkg/specgen/generate/oci.go
@@ -96,8 +96,10 @@ func makeCommand(ctx context.Context, s *specgen.SpecGenerator, img *image.Image
finalCommand = append(finalCommand, entrypoint...)
+ // Only use image command if the user did not manually set an
+ // entrypoint.
command := s.Command
- if command == nil && img != nil {
+ if command == nil && img != nil && s.Entrypoint == nil {
newCmd, err := img.Cmd(ctx)
if err != nil {
return nil, err
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 9cb76d1f6..dc44d3b3f 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -1143,7 +1143,7 @@ USER mail`
Expect(session.ErrorToString()).To(ContainSubstring("Invalid umask"))
})
- It("podman run makes entrypoint from image", func() {
+ It("podman run makes workdir from image", func() {
// BuildImage does not seem to work remote
SkipIfRemote()
dockerfile := `FROM busybox
@@ -1154,4 +1154,13 @@ WORKDIR /madethis`
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(ContainSubstring("/madethis"))
})
+
+ It("podman run --entrypoint does not use image command", func() {
+ session := podmanTest.Podman([]string{"run", "--entrypoint", "/bin/echo", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ // We can't guarantee the output is completely empty, some
+ // nonprintables seem to work their way in.
+ Expect(session.OutputToString()).To(Not(ContainSubstring("/bin/sh")))
+ })
})
diff --git a/test/system/120-load.bats b/test/system/120-load.bats
index 4825eed07..2fcabcd8a 100644
--- a/test/system/120-load.bats
+++ b/test/system/120-load.bats
@@ -28,8 +28,6 @@ verify_iid_and_name() {
@test "podman load - by image ID" {
- skip_if_remote "FIXME: pending #7123"
-
# FIXME: how to build a simple archive instead?
get_iid_and_name