update to golang 1.20 (#9690)

update alpine and golang
remove nano
update go modules
remove need for openssl external cli
fix stale

Signed-off-by: James Strong <james.strong@chainguard.dev>
This commit is contained in:
James Strong 2023-03-11 23:38:39 -05:00 committed by GitHub
parent ddcfaecb3c
commit 66a760794f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 59 additions and 40 deletions

View file

@ -88,7 +88,7 @@ jobs:
id: go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.19'
go-version: '1.20'
check-latest: true
- name: Run Lint
@ -107,7 +107,7 @@ jobs:
id: go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.19'
go-version: '1.20'
check-latest: true
- name: Run go-fmt
@ -126,7 +126,7 @@ jobs:
id: go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.19'
go-version: '1.20'
check-latest: true
- name: Run test
@ -147,7 +147,7 @@ jobs:
id: go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.19'
go-version: '1.20'
check-latest: true
- name: Set up QEMU
@ -213,7 +213,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.19'
go-version: '1.20'
check-latest: true
- name: cache
@ -485,7 +485,7 @@ jobs:
if: ${{ steps.filter-images.outputs.kube-webhook-certgen == 'true' }}
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.19'
go-version: '1.20'
check-latest: true
- name: kube-webhook-certgen image build

View file

@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: 1.19
go-version: 1.20
check-latest: true
- name: Run GoReleaser

View file

@ -15,8 +15,8 @@ jobs:
steps:
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b # v7.0.0
with:
stale-issue-message: 'This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach `#ingress-nginx-dev` on Kubernetes Slack.'
stale-pr-message: 'This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach `#ingress-nginx-dev` on Kubernetes Slack.'
stale-issue-message: "This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach `#ingress-nginx-dev` on Kubernetes Slack."
stale-pr-message: "This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach `#ingress-nginx-dev` on Kubernetes Slack."
stale-issue-label: lifecycle/frozen
stale-pr-label: lifecycle/frozen
days-before-issue-stale: 30

4
go.mod
View file

@ -1,6 +1,6 @@
module k8s.io/ingress-nginx
go 1.19
go 1.20
require (
github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a
@ -93,7 +93,7 @@ require (
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/xlab/treeprint v1.1.0 // indirect

4
go.sum
View file

@ -332,8 +332,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM alpine:3.17.0
FROM alpine:3.17.2
RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --no-cache \

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.19.4-alpine3.17 as builder
FROM golang:1.20.1-alpine3.17 as builder
RUN apk add git
WORKDIR /go/src/k8s.io/ingress-nginx/images/custom-error-pages

View file

@ -1,6 +1,6 @@
module k8s.io/ingress-nginx/custom-error-pages
go 1.19
go 1.20
require github.com/prometheus/client_golang v1.11.1

View file

@ -1,4 +1,4 @@
FROM golang:1.19.4-alpine3.17 as builder
FROM golang:1.20.1-alpine3.17 as builder
RUN mkdir /authsvc
WORKDIR /authsvc
COPY . ./

View file

@ -1,6 +1,6 @@
module example.com/authsvc
go 1.19
go 1.20
require k8s.io/apimachinery v0.23.1

View file

@ -105,7 +105,19 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -129,7 +141,12 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.19.4-alpine3.17 as builder
FROM golang:1.20.1-alpine3.17 as builder
WORKDIR /go/src/k8s.io/ingress-nginx/images/fastcgi

View file

@ -1,4 +1,4 @@
FROM golang:1.19.4-alpine3.17 as build
FROM golang:1.20.1-alpine3.17 as build
WORKDIR /go/src/greeter-server

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM alpine:3.17.0
FROM alpine:3.17.2
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM --platform=$BUILDPLATFORM golang:1.19.4 as builder
FROM --platform=$BUILDPLATFORM golang:1.20.1 as builder
ARG BUILDPLATFORM
ARG TARGETARCH

View file

@ -1,6 +1,6 @@
module github.com/jet/kube-webhook-certgen
go 1.19
go 1.20
require (
github.com/onrik/logrus v0.9.0

View file

@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM alpine:3.17.0 as builder
FROM alpine:3.17.2 as builder
COPY . /
@ -21,7 +21,7 @@ RUN apk update \
&& /build.sh
# Use a multi-stage build
FROM alpine:3.17.0
FROM alpine:3.17.2
ENV PATH=$PATH:/usr/local/luajit/bin:/usr/local/nginx/sbin:/usr/local/nginx/bin
@ -49,7 +49,6 @@ RUN apk update \
libmaxminddb \
yaml-cpp \
dumb-init \
nano \
tzdata \
&& ln -s /usr/local/nginx/sbin/nginx /sbin/nginx \
&& adduser -S -D -H -u 101 -h /usr/local/nginx \

View file

@ -13,7 +13,7 @@
# limitations under the License.
FROM alpine:3.17.0 as base
FROM alpine:3.17.2 as base
RUN mkdir -p /opt/third_party/install
COPY . /opt/third_party/
@ -39,7 +39,7 @@ COPY --from=grpc /opt/third_party/install/ /usr
COPY --from=otel-cpp /opt/third_party/install/ /usr
RUN bash /opt/third_party/build.sh -n
FROM alpine:3.17.0 as final
FROM alpine:3.17.2 as final
COPY --from=base /opt/third_party/init_module.sh /usr/local/bin/init_module.sh
COPY --from=nginx /etc/nginx/modules /etc/nginx/modules
COPY --from=nginx /opt/third_party/install/lib /etc/nginx/modules

View file

@ -39,7 +39,7 @@ build: ensure-buildx
--progress=$(PROGRESS) \
--pull \
--build-arg BASE_IMAGE=$(NGINX_BASE_IMAGE) \
--build-arg GOLANG_VERSION=1.19.4 \
--build-arg GOLANG_VERSION=1.20.1 \
--build-arg ETCD_VERSION=3.4.3-0 \
--build-arg K8S_RELEASE=v1.24.2 \
--build-arg RESTY_CLI_VERSION=0.27 \

View file

@ -1,6 +1,6 @@
module github.com/kubernetes/ingress-nginx/magefiles
go 1.19
go 1.20
require (
github.com/blang/semver/v4 v4.0.0

View file

@ -23,7 +23,7 @@ RUN apk update \
&& apk upgrade \
&& /chroot.sh
FROM alpine:3.17.0
FROM alpine:3.17.2
ARG TARGETARCH
ARG VERSION
@ -49,8 +49,8 @@ RUN apk update \
&& apk upgrade \
&& apk add -U --no-cache \
bash \
curl \
openssl \
curl \
ca-certificates \
dumb-init \
tzdata \

View file

@ -1,7 +1,7 @@
ARG E2E_BASE_IMAGE
FROM ${E2E_BASE_IMAGE} AS BASE
FROM alpine:3.16.2
FROM alpine:3.17.2
RUN apk add -U --no-cache \
ca-certificates \

View file

@ -19,9 +19,9 @@ package annotations
import (
"context"
"fmt"
"golang.org/x/crypto/bcrypt"
"net/http"
"net/url"
"os/exec"
"regexp"
"strings"
"time"
@ -899,7 +899,8 @@ http {
// Auth error
func buildSecret(username, password, name, namespace string) *corev1.Secret {
out, err := exec.Command("openssl", "passwd", "-crypt", password).CombinedOutput()
//out, err := exec.Command("openssl", "passwd", "-crypt", password).CombinedOutput()
out, err := bcrypt.GenerateFromPassword([]byte(password), 14)
encpass := fmt.Sprintf("%v:%s\n", username, out)
assert.Nil(ginkgo.GinkgoT(), err)
@ -917,7 +918,8 @@ func buildSecret(username, password, name, namespace string) *corev1.Secret {
}
func buildMapSecret(username, password, name, namespace string) *corev1.Secret {
out, err := exec.Command("openssl", "passwd", "-crypt", password).CombinedOutput()
//out, err := exec.Command("openssl", "passwd", "-crypt", password).CombinedOutput()
out, err := bcrypt.GenerateFromPassword([]byte(password), 14)
assert.Nil(ginkgo.GinkgoT(), err)
return &corev1.Secret{

View file

@ -18,8 +18,8 @@ package settings
import (
"fmt"
"golang.org/x/crypto/bcrypt"
"net/http"
"os/exec"
"strings"
"github.com/onsi/ginkgo/v2"
@ -147,7 +147,8 @@ func buildBasicAuthIngressWithSecondPath(host, namespace, secretName, pathName s
}
func buildSecret(username, password, name, namespace string) *corev1.Secret {
out, err := exec.Command("openssl", "passwd", "-crypt", password).CombinedOutput()
//out, err := exec.Command("openssl", "passwd", "-crypt", password).CombinedOutput()
out, err := bcrypt.GenerateFromPassword([]byte(password), 14)
assert.Nil(ginkgo.GinkgoT(), err, "creating password")
encpass := fmt.Sprintf("%v:%s\n", username, out)