Merge pull request #63453 from nitkon/master

Automatic merge from submit-queue (batch tested with PRs 63453, 64592, 64482, 64618, 64661). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add Makefile target to push fat manifest for multi-arch images

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>



**What this PR does / why we need it**:
This PR adds support to push fat manifest for multi-arch images. We need this
so that we can seamlessly pull and run the test images on multiple platforms. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
pull/8/head
Kubernetes Submit Queue 2018-06-04 16:56:08 -07:00 committed by GitHub
commit edff14935e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
include ../../hack/make-rules/Makefile.manifest
REGISTRY ?= gcr.io/kubernetes-e2e-test-images REGISTRY ?= gcr.io/kubernetes-e2e-test-images
GOARM=7 GOARM=7
QEMUVERSION=v2.9.1 QEMUVERSION=v2.9.1
@ -34,7 +36,7 @@ all: all-container
all-container: all-container:
./image-util.sh build $(WHAT) ./image-util.sh build $(WHAT)
all-push: all-container all-push: all-container manifest-tool
./image-util.sh push $(WHAT) ./image-util.sh push $(WHAT)
.PHONY: all all-push all-container .PHONY: all all-push all-container

View File

@ -99,6 +99,10 @@ push() {
TAG=$(<${IMAGE}/VERSION) TAG=$(<${IMAGE}/VERSION)
docker push ${REGISTRY}/${IMAGE}-${arch}:${TAG} docker push ${REGISTRY}/${IMAGE}-${arch}:${TAG}
done done
# Make archs list into OS/architecture pair. Eg: 'amd64 ppc64le' to 'linux/amd64,linux/ppc64le'
archs=$(echo $archs | sed -e 's/[^ ]* */linux\/&/g' -e 's/ /,/g')
manifest-tool push from-args --platforms ${archs} --template ${REGISTRY}/${IMAGE}-ARCH:${TAG} --target ${REGISTRY}/${IMAGE}:${TAG}
} }
# This function is for building the go code # This function is for building the go code