diff --git a/files/policy.json b/files/policy.json new file mode 100644 index 000000000..ab25c67e7 --- /dev/null +++ b/files/policy.json @@ -0,0 +1,16 @@ +{ + "default": [ + { + "type": "insecureAcceptAnything" + } + ], + "transports": { + "docker-daemon": { + "": [ + { + "type": "insecureAcceptAnything" + } + ] + } + } +} diff --git a/pkg/image/image.go b/pkg/image/image.go index c58ad0703..6aa2364bb 100644 --- a/pkg/image/image.go +++ b/pkg/image/image.go @@ -1,9 +1,12 @@ /* Copyright 2018 Google LLC + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,12 +63,11 @@ func PushImage(destImg string) error { return err } logrus.Infof("Pushing image to %s", destImg) - err = copy.Image(policyContext, destRef, srcRef, nil) - return err + return copy.Image(policyContext, destRef, srcRef, nil) } func getPolicyContext() (*signature.PolicyContext, error) { - policy, err := signature.NewPolicyFromFile(constants.PolicyJsonPath) + policy, err := signature.NewPolicyFromFile(constants.PolicyJSONPath) if err != nil { logrus.Debugf("Error retrieving policy: %s", err) return nil, err