From ce6efadd5cfe48bc8af4798a4747b74398cb4a1e Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 15 Sep 2020 13:23:42 +0200 Subject: run/create: record raw image Record the user-specified "raw" image name in the SpecGenerator, so we can pass it along to the config when creating a container. We need a separate field as the image name in the generator may be set to the ID of the previously pulled image - ultimately the cause of #7404. Reverting the image name from the ID to the user input would not work since "alpine" for pulling iterates over the search registries in the registries.conf but looking up "alpine" normalizes to "localhost/alpine". Recording the raw-image name directly in the generator was the best of the options I considered as no hidden magic from search registries or normalizations (that may or may not change in the future) can interfere. The auto-update backend enforces that the raw-image name is a fully-qualified reference, so we need to worry about that in the front end. Fixes: #7407 Signed-off-by: Valentin Rothberg --- pkg/specgen/specgen.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/specgen/specgen.go') diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index cca05eddb..b8f37ec7a 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -89,6 +89,9 @@ type ContainerBasicConfig struct { // If not given, a default location will be used. // Optional. ConmonPidFile string `json:"conmon_pid_file,omitempty"` + // RawImageName is the user-specified and unprocessed input referring + // to a local or a remote image. + RawImageName string `json:"raw_image_name,omitempty"` // RestartPolicy is the container's restart policy - an action which // will be taken when the container exits. // If not given, the default policy, which does nothing, will be used. -- cgit v1.2.3-54-g00ecf