Skip to content

Commit

Permalink
DO NOT MERGE! Revert "Properly handle podman run --pull command"
Browse files Browse the repository at this point in the history
DO NOT MERGE! This is a dummy PR for the sole purpose of
running CI tests.

I really need to understand why my system tests did not catch
the "podman run --pull" problem addressed by containers#7770. So this
commit leaves the new tests in place, but reverts the code
changes. That should make these tests fail, and I will be
better able to understand why my tests failed to catch it.

I thought I had ginkgo working on my laptop, but running:

   ginkgo -trace -debug -r -focus 'with --pull' test/e2e

...only yields success. I suspect there's something deeper
going on here but can only find out by running the full CI
test suite. Sorry to be wasting cycles.

This reverts commit 1b5853e.

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed Sep 29, 2020
1 parent 5cf8659 commit 3cce113
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cmd/podman/common/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
)
createFlags.StringVar(
&cf.Pull,
"pull", containerConfig.Engine.PullPolicy,
"pull", "missing",
`Pull image before creating ("always"|"missing"|"never")`,
)
createFlags.BoolVarP(
Expand Down
1 change: 0 additions & 1 deletion cmd/podman/containers/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ func pullImage(imageName string) (string, error) {
OverrideOS: cliVals.OverrideOS,
OverrideVariant: cliVals.OverrideVariant,
SignaturePolicy: cliVals.SignaturePolicy,
PullPolicy: pullPolicy,
})
if pullErr != nil {
return "", pullErr
Expand Down
2 changes: 1 addition & 1 deletion libpod/image/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func findImageInRepotags(search imageParts, images []*Image) (*storage.Image, er
continue
}
// account for registry:/somedir/image
if strings.HasSuffix(dName, "/"+searchName) && dSuspiciousTagValueForSearch == searchSuspiciousTagValueForSearch {
if strings.HasSuffix(dName, searchName) && dSuspiciousTagValueForSearch == searchSuspiciousTagValueForSearch {
results = append(results, image.image)
continue
}
Expand Down
14 changes: 2 additions & 12 deletions pkg/api/handlers/compat/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"strings"

"github.com/containers/buildah"
"github.com/containers/common/pkg/config"
"github.com/containers/image/v5/manifest"
"github.com/containers/podman/v2/libpod"
image2 "github.com/containers/podman/v2/libpod/image"
"github.com/containers/podman/v2/pkg/api/handlers"
"github.com/containers/podman/v2/pkg/api/handlers/utils"
"github.com/containers/podman/v2/pkg/auth"
"github.com/containers/podman/v2/pkg/domain/entities"
"github.com/containers/podman/v2/pkg/util"
"github.com/docker/docker/api/types"
"github.com/gorilla/schema"
"github.com/pkg/errors"
Expand Down Expand Up @@ -268,16 +268,6 @@ func CreateImageFromImage(w http.ResponseWriter, r *http.Request) {
if sys := runtime.SystemContext(); sys != nil {
registryOpts.DockerCertPath = sys.DockerCertPath
}
rtc, err := runtime.GetConfig()
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Decode()"))
return
}
pullPolicy, err := config.ValidatePullPolicy(rtc.Engine.PullPolicy)
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "Decode()"))
return
}
img, err := runtime.ImageRuntime().New(r.Context(),
fromImage,
"", // signature policy
Expand All @@ -286,7 +276,7 @@ func CreateImageFromImage(w http.ResponseWriter, r *http.Request) {
&registryOpts,
image2.SigningOptions{},
nil, // label
pullPolicy,
util.PullImageMissing,
)
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err)
Expand Down
7 changes: 2 additions & 5 deletions pkg/domain/entities/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package entities
import (
"time"

"github.com/containers/common/pkg/config"
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/types"
"github.com/containers/podman/v2/pkg/inspect"
Expand Down Expand Up @@ -120,8 +119,8 @@ type ImageHistoryReport struct {

// ImagePullOptions are the arguments for pulling images.
type ImagePullOptions struct {
// AllTags can be specified to pull all tags of an image. Note
// that this only works if the image does not include a tag.
// AllTags can be specified to pull all tags of the spiecifed image. Note
// that this only works if the specified image does not include a tag.
AllTags bool
// Authfile is the path to the authentication file. Ignored for remote
// calls.
Expand All @@ -147,8 +146,6 @@ type ImagePullOptions struct {
SignaturePolicy string
// SkipTLSVerify to skip HTTPS and certificate verification.
SkipTLSVerify types.OptionalBool
// PullPolicy whether to pull new image
PullPolicy config.PullPolicy
}

// ImagePullReport is the response from pulling one or more images.
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/infra/abi/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func pull(ctx context.Context, runtime *image.Runtime, rawImage string, options
}

if !options.AllTags {
newImage, err := runtime.New(ctx, rawImage, options.SignaturePolicy, options.Authfile, writer, &dockerRegistryOptions, image.SigningOptions{}, label, options.PullPolicy)
newImage, err := runtime.New(ctx, rawImage, options.SignaturePolicy, options.Authfile, writer, &dockerRegistryOptions, image.SigningOptions{}, label, util.PullImageAlways)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3cce113

Please sign in to comment.