Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/2.8] bump up golang version (alternative) #3903

Merged
merged 7 commits into from May 9, 2023

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented May 9, 2023

Backports of:

Diff with #3812

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..e660fd93
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+bin/
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 22d16e74..7da7e640 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -87,7 +87,6 @@ jobs:
           draft: true
           files: |
             bin/*.tar.gz
-            bin/*.zip
             bin/*.sha256
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/Dockerfile b/Dockerfile
index 913e2c37..bfa4a694 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,7 +13,7 @@ ENV CGO_ENABLED=0
 WORKDIR /go/src/github.com/docker/distribution
 
 FROM base AS version
-ARG PKG="github.com/distribution/distribution"
+ARG PKG="github.com/docker/distribution"
 RUN --mount=target=. \
   VERSION=$(git describe --match 'v[0-9]*' --dirty='.m' --always --tags) REVISION=$(git rev-parse HEAD)$(if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi); \
   echo "-X ${PKG}/version.Version=${VERSION#v} -X ${PKG}/version.Revision=${REVISION} -X ${PKG}/version.Package=${PKG}" | tee /tmp/.ldflags; \
diff --git a/docker-bake.hcl b/docker-bake.hcl
index 4dd5a100..91686e60 100644
--- a/docker-bake.hcl
+++ b/docker-bake.hcl
@@ -1,15 +1,3 @@
-// GITHUB_REF is the actual ref that triggers the workflow
-// https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
-variable "GITHUB_REF" {
-  default = ""
-}
-
-target "_common" {
-  args = {
-    GIT_REF = GITHUB_REF
-  }
-}
-
 group "default" {
   targets = ["image-local"]
 }
@@ -20,13 +8,11 @@ target "docker-metadata-action" {
 }
 
 target "binary" {
-  inherits = ["_common"]
   target = "binary"
   output = ["./bin"]
 }
 
 target "artifact" {
-  inherits = ["_common"]
   target = "artifact"
   output = ["./bin"]
 }
@@ -43,8 +29,13 @@ target "artifact-all" {
   ]
 }
 
+// Special target: https://github.com/docker/metadata-action#bake-definition
+target "docker-metadata-action" {
+  tags = ["registry:local"]
+}
+
 target "image" {
-  inherits = ["_common", "docker-metadata-action"]
+  inherits = ["docker-metadata-action"]
 }
 
 target "image-local" {
diff --git a/registry/handlers/basicauth_prego14.go b/registry/handlers/basicauth_prego14.go
index 6cf10a25..01290adf 100644
--- a/registry/handlers/basicauth_prego14.go
+++ b/registry/handlers/basicauth_prego14.go
@@ -1,3 +1,4 @@
+//go:build !go1.4
 // +build !go1.4
 
 package handlers
diff --git a/registry/storage/blobwriter_nonresumable.go b/registry/storage/blobwriter_nonresumable.go
index 32f13097..38267cf6 100644
--- a/registry/storage/blobwriter_nonresumable.go
+++ b/registry/storage/blobwriter_nonresumable.go
@@ -1,3 +1,4 @@
+//go:build noresumabledigest
 // +build noresumabledigest
 
 package storage
diff --git a/registry/storage/driver/gcs/gcs.go b/registry/storage/driver/gcs/gcs.go
index 86dc87f1..66d0d1ad 100644
--- a/registry/storage/driver/gcs/gcs.go
+++ b/registry/storage/driver/gcs/gcs.go
@@ -10,6 +10,7 @@
 // Note that the contents of incomplete uploads are not accessible even though
 // Stat returns their length
 //
+//go:build include_gcs
 // +build include_gcs
 
 package gcs
diff --git a/registry/storage/driver/gcs/gcs_test.go b/registry/storage/driver/gcs/gcs_test.go
index e58216be..4ae9aa3f 100644
--- a/registry/storage/driver/gcs/gcs_test.go
+++ b/registry/storage/driver/gcs/gcs_test.go
@@ -1,3 +1,4 @@
+//go:build include_gcs
 // +build include_gcs
 
 package gcs
diff --git a/registry/storage/driver/oss/oss.go b/registry/storage/driver/oss/oss.go
index 1dcf42b8..8738b1e0 100644
--- a/registry/storage/driver/oss/oss.go
+++ b/registry/storage/driver/oss/oss.go
@@ -7,6 +7,7 @@
 // Because OSS is a key, value store the Stat call does not support last modification
 // time for directories (directories are an abstraction for key, value stores)
 //
+//go:build include_oss
 // +build include_oss
 
 package oss
diff --git a/registry/storage/driver/oss/oss_test.go b/registry/storage/driver/oss/oss_test.go
index 438d9a48..e042bb75 100644
--- a/registry/storage/driver/oss/oss_test.go
+++ b/registry/storage/driver/oss/oss_test.go
@@ -1,3 +1,4 @@
+//go:build include_oss
 // +build include_oss
 
 package oss

thaJeztah and others added 7 commits May 9, 2023 10:53
The 2.8 release is still named github.com/docker/distribution.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Wang Yan <wangyan@vmware.com>
(cherry picked from commit 3f4c558)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 87f93ed)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 52a88c5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit b066451)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 0e17e54)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
upgrade go version to v1.18.8

Signed-off-by: Wang Yan <wangyan@vmware.com>
@thaJeztah
Copy link
Member Author

@crazy-max PTAL if the diff looks correct 😅

@milosgajdos milosgajdos requested a review from corhere May 9, 2023 09:41
Copy link
Contributor

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not for this pr but we should bump some actions as Node 12 is deprecated: https://github.com/distribution/distribution/actions/runs/4924320699

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, docker/metadata-action@v3, docker/setup-buildx-action@v1, docker/bake-action@v1, actions/upload-artifact@v2. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

image

ARG GORELEASER_XX_VERSION=1.2.5
ARG GO_VERSION=1.18.8
ARG ALPINE_VERSION=3.16
ARG XX_VERSION=1.1.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should update to 1.2.1 in follow-up

@thaJeztah
Copy link
Member Author

Thanks @crazy-max !

I'll do a follow-up to go1.19.9 as well (as go1.18 is EOL)

@milosgajdos milosgajdos merged commit d3fac54 into distribution:release/2.8 May 9, 2023
3 checks passed
@thaJeztah thaJeztah deleted the 2.8_bump_go_118 branch May 9, 2023 13:13
nrdufour added a commit to nrdufour/home-ops that referenced this pull request Jul 29, 2023
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [registry](https://github.com/distribution/distribution) | patch | `2.8.1` -> `2.8.2` |

---

### Release Notes

<details>
<summary>distribution/distribution (registry)</summary>

### [`v2.8.2`](https://github.com/distribution/distribution/releases/tag/v2.8.2)

[Compare Source](distribution/distribution@v2.8.1...v2.8.2)

##### What's Changed

-   Revert registry/client: set `Accept: identity` header when getting layers by [@&#8203;ndeloof](https://github.com/ndeloof) in distribution/distribution#3783
-   Parse `http` forbidden as denied by [@&#8203;vvoland](https://github.com/vvoland) in distribution/distribution#3914
-   Fix [CVE-2022-28391](https://www.cve.org/CVERecord?id=CVE-2022-28391) by bumping alpine from 3.14 to 3.16 by [@&#8203;thaJeztah](https://github.com/thaJeztah) ([#&#8203;3650](distribution/distribution#3650))
-   Fix [CVE-2023-2253](https://www.cve.org/CVERecord?id=CVE-2023-2253) runaway allocation on /v2/\_catalog  by [@&#8203;josegomezr](https://github.com/josegomezr) [`521ea3d9`](distribution/distribution@521ea3d)
-   Fix panic in inmemory driver by [@&#8203;wy65701436](https://github.com/wy65701436) in distribution/distribution#3815
-   bump up golang version (alternative) by [@&#8203;thaJeztah](https://github.com/thaJeztah) in distribution/distribution#3903
-   Dockerfile: update xx to v1.2.1 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in distribution/distribution#3907
-   update to go1.19.9 by [@&#8203;thaJeztah](https://github.com/thaJeztah) in distribution/distribution#3908
-   Add code to handle pagination of parts. Fixes max layer size of 10GB bug by [@&#8203;DavidSpek](https://github.com/DavidSpek) in distribution/distribution#3893
-   Dockerfile: fix filenames of artifacts by [@&#8203;thaJeztah](https://github.com/thaJeztah) in distribution/distribution#3911

**Full Changelog**: distribution/distribution@v2.8.1...v2.8.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yMy4yIiwidXBkYXRlZEluVmVyIjoiMzYuMjMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Reviewed-on: https://git.home/nrdufour/home-ops/pulls/20
Co-authored-by: Renovate <renovate@ptinem.io>
Co-committed-by: Renovate <renovate@ptinem.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants