From edb41bd150f53484f4c7295c382f2a2d4db7d2e7 Mon Sep 17 00:00:00 2001 From: Josh Dolitsky <393494+jdolitsky@users.noreply.github.com> Date: Tue, 15 Jun 2021 13:18:48 -0400 Subject: [PATCH] Upgrade to oras-go v0.4.0 (#281) Signed-off-by: Josh Dolitsky --- .github/workflows/build-pr.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/release-github.yml | 2 +- .goreleaser.yml | 2 +- Dockerfile | 2 +- Makefile | 2 +- cmd/oras/cache.go | 3 +-- cmd/oras/login.go | 3 +-- cmd/oras/logout.go | 3 +-- cmd/oras/pull.go | 9 ++++----- cmd/oras/push.go | 9 ++++----- cmd/oras/resolver.go | 3 +-- cmd/oras/version.go | 4 ++-- go.mod | 4 ++-- go.sum | 15 ++++++++------- 15 files changed, 30 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index a6645c86b..c24096bd3 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -14,7 +14,7 @@ jobs: - name: setup go environment uses: actions/setup-go@v1 with: - go-version: '1.16.3' + go-version: '1.16.5' - name: Build CLI run: make build-linux - name: Check version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b7e0789d..a9404d65f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: setup go environment uses: actions/setup-go@v1 with: - go-version: '1.16.3' + go-version: '1.16.5' - name: Build CLI run: make build-linux - name: Check version diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index 7df4acad7..4639e556b 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -14,7 +14,7 @@ jobs: - name: setup go environment uses: actions/setup-go@v1 with: - go-version: '1.16.3' + go-version: '1.16.5' - name: run goreleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index adf37ed3e..43c9c75de 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -19,7 +19,7 @@ builds: ldflags: # one-line ldflags to bypass the goreleaser bugs # the git tree state is guaranteed to be clean by goreleaser - - -w -X github.com/oras-project/oras/internal/version.Version={{.Version}} -X github.com/oras-project/oras/internal/version.GitCommit={{.FullCommit}} -X github.com/oras-project/oras/internal/version.BuildMetadata= -X github.com/oras-project/oras/internal/version.GitTreeState=clean + - -w -X oras.land/oras/internal/version.Version={{.Version}} -X oras.land/oras/internal/version.GitCommit={{.FullCommit}} -X oras.land/oras/internal/version.BuildMetadata= -X oras.land/oras/internal/version.GitTreeState=clean archives: - format: tar.gz diff --git a/Dockerfile b/Dockerfile index bf90fcaa4..73082b9c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/library/golang:1.16.3-alpine as builder +FROM docker.io/library/golang:1.16.5-alpine as builder RUN apk add git make ENV ORASPKG /oras ADD . ${ORASPKG} diff --git a/Makefile b/Makefile index f05eec1f3..f1e663b98 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PROJECT_PKG = github.com/oras-project/oras +PROJECT_PKG = oras.land/oras CLI_EXE = oras CLI_PKG = $(PROJECT_PKG)/cmd/oras GIT_COMMIT = $(shell git rev-parse HEAD) diff --git a/cmd/oras/cache.go b/cmd/oras/cache.go index 7ca5db33a..68deab9ec 100644 --- a/cmd/oras/cache.go +++ b/cmd/oras/cache.go @@ -3,14 +3,13 @@ package main import ( "context" - orascontent "github.com/oras-project/oras-go/pkg/content" - "github.com/containerd/containerd/content" "github.com/containerd/containerd/content/local" "github.com/containerd/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" + orascontent "oras.land/oras-go/pkg/content" ) type cachedStore struct { diff --git a/cmd/oras/login.go b/cmd/oras/login.go index 7f491bca4..a8053dd1f 100644 --- a/cmd/oras/login.go +++ b/cmd/oras/login.go @@ -9,11 +9,10 @@ import ( "os" "strings" - auth "github.com/oras-project/oras-go/pkg/auth/docker" - "github.com/docker/docker/pkg/term" "github.com/sirupsen/logrus" "github.com/spf13/cobra" + auth "oras.land/oras-go/pkg/auth/docker" ) type loginOptions struct { diff --git a/cmd/oras/logout.go b/cmd/oras/logout.go index f7eb47a21..0105d2061 100644 --- a/cmd/oras/logout.go +++ b/cmd/oras/logout.go @@ -3,10 +3,9 @@ package main import ( "context" - auth "github.com/oras-project/oras-go/pkg/auth/docker" - "github.com/sirupsen/logrus" "github.com/spf13/cobra" + auth "oras.land/oras-go/pkg/auth/docker" ) type logoutOptions struct { diff --git a/cmd/oras/pull.go b/cmd/oras/pull.go index 4fb390253..fd3a13394 100644 --- a/cmd/oras/pull.go +++ b/cmd/oras/pull.go @@ -6,16 +6,15 @@ import ( "os" "sync" - "github.com/oras-project/oras-go/pkg/artifact" - "github.com/oras-project/oras-go/pkg/content" - ctxo "github.com/oras-project/oras-go/pkg/context" - "github.com/oras-project/oras-go/pkg/oras" - "github.com/containerd/containerd/images" "github.com/containerd/containerd/reference" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "github.com/spf13/cobra" + "oras.land/oras-go/pkg/artifact" + "oras.land/oras-go/pkg/content" + ctxo "oras.land/oras-go/pkg/context" + "oras.land/oras-go/pkg/oras" ) type pullOptions struct { diff --git a/cmd/oras/push.go b/cmd/oras/push.go index 587d48b6f..07b84691d 100644 --- a/cmd/oras/push.go +++ b/cmd/oras/push.go @@ -7,14 +7,13 @@ import ( "os" "path/filepath" - "github.com/oras-project/oras-go/pkg/artifact" - "github.com/oras-project/oras-go/pkg/content" - ctxo "github.com/oras-project/oras-go/pkg/context" - "github.com/oras-project/oras-go/pkg/oras" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "github.com/spf13/cobra" + "oras.land/oras-go/pkg/artifact" + "oras.land/oras-go/pkg/content" + ctxo "oras.land/oras-go/pkg/context" + "oras.land/oras-go/pkg/oras" ) const ( diff --git a/cmd/oras/resolver.go b/cmd/oras/resolver.go index 30c4faed6..ed68eaf19 100644 --- a/cmd/oras/resolver.go +++ b/cmd/oras/resolver.go @@ -7,10 +7,9 @@ import ( "net/http" "os" - auth "github.com/oras-project/oras-go/pkg/auth/docker" - "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + auth "oras.land/oras-go/pkg/auth/docker" ) func newResolver(username, password string, insecure bool, plainHTTP bool, configs ...string) remotes.Resolver { diff --git a/cmd/oras/version.go b/cmd/oras/version.go index 30defebbb..81c6eeb34 100644 --- a/cmd/oras/version.go +++ b/cmd/oras/version.go @@ -5,9 +5,9 @@ import ( "runtime" "strings" - "github.com/oras-project/oras/internal/version" - "github.com/spf13/cobra" + + "oras.land/oras/internal/version" ) func versionCmd() *cobra.Command { diff --git a/go.mod b/go.mod index 9a2f76f67..77d855416 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/oras-project/oras +module oras.land/oras go 1.16 @@ -14,8 +14,8 @@ require ( github.com/docker/docker v17.12.1-ce+incompatible github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.1 - github.com/oras-project/oras-go v0.1.0 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.1.3 + oras.land/oras-go v0.4.0 ) diff --git a/go.sum b/go.sum index 519afc29e..5a1c32074 100644 --- a/go.sum +++ b/go.sum @@ -142,7 +142,6 @@ github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7 github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.0-rc.3/go.mod h1:kYiJ+LvywDUKzyax6+UKCk5xwQNCfcGR6KsSdShdg5U= github.com/containerd/containerd v1.5.2 h1:MG/Bg1pbmMb61j3wHCFWPxESXHieiKr2xG64px/k8zQ= github.com/containerd/containerd v1.5.2/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -226,8 +225,8 @@ github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v20.10.6+incompatible h1:LAyI6Lnwv+AUjtp2ZyN1lxqXBtkeFUqm4H7CZMWZuP8= -github.com/docker/cli v20.10.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v20.10.7+incompatible h1:pv/3NqibQKphWZiAskMzdz8w0PRbtTaEB+f6NwdU7Is= +github.com/docker/cli v20.10.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20191216044856-a8371794149d h1:jC8tT/S0OGx2cswpeUTn4gOIea8P08lD3VFQT0cOZ50= github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= @@ -507,8 +506,6 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.m github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/oras-project/oras-go v0.1.0 h1:mWWO1nAdcHQSC/zTUkckgDUOeGu1Tnxwyph1C8zKqsE= -github.com/oras-project/oras-go v0.1.0/go.mod h1:uts4oKaEWR4D+pajh79zPDGFJrx2aAtcVqC2jNb/8vM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= @@ -669,8 +666,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -751,8 +749,9 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1002,6 +1001,8 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +oras.land/oras-go v0.4.0 h1:u6+7D+raZDYHwlz/uOwNANiRmyYDSSMW7A9E1xXycUQ= +oras.land/oras-go v0.4.0/go.mod h1:VJcU+VE4rkclUbum5C0O7deEZbBYnsnpbGSACwTjOcg= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=