From 142ec6aa98fc8a1231fc321e9d1a33b637c6bc70 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 28 Feb 2018 12:22:26 -0800 Subject: [PATCH] Fixed image --- files/policy.json | 16 ++++++++++++++++ pkg/image/image.go | 8 +++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 files/policy.json 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