Skip to content

Commit

Permalink
update to golang 1.20 (#9690)
Browse files Browse the repository at this point in the history
update alpine and golang
remove nano
update go modules
remove need for openssl external cli
fix stale

Signed-off-by: James Strong <[email protected]>
  • Loading branch information
strongjz authored Mar 12, 2023
1 parent ddcfaec commit 66a7607
Show file tree
Hide file tree
Showing 24 changed files with 59 additions and 40 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion images/cfssl/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion images/custom-error-pages/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion images/custom-error-pages/rootfs/go.mod
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion images/ext-auth-example-authsvc/rootfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . ./
Expand Down
2 changes: 1 addition & 1 deletion images/ext-auth-example-authsvc/rootfs/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module example.com/authsvc

go 1.19
go 1.20

require k8s.io/apimachinery v0.23.1

Expand Down
21 changes: 19 additions & 2 deletions images/ext-auth-example-authsvc/rootfs/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion images/fastcgi-helloserver/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion images/go-grpc-greeter-server/rootfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion images/httpbin/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion images/kube-webhook-certgen/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion images/kube-webhook-certgen/rootfs/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions images/nginx/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . /

Expand All @@ -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

Expand Down Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions images/opentelemetry/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
2 changes: 1 addition & 1 deletion images/test-runner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion magefiles/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions rootfs/Dockerfile-chroot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,8 +49,8 @@ RUN apk update \
&& apk upgrade \
&& apk add -U --no-cache \
bash \
curl \
openssl \
curl \
ca-certificates \
dumb-init \
tzdata \
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
8 changes: 5 additions & 3 deletions test/e2e/annotations/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package annotations
import (
"context"
"fmt"
"golang.org/x/crypto/bcrypt"
"net/http"
"net/url"
"os/exec"
"regexp"
"strings"
"time"
Expand Down Expand Up @@ -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)

Expand All @@ -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{
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/settings/no_auth_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package settings

import (
"fmt"
"golang.org/x/crypto/bcrypt"
"net/http"
"os/exec"
"strings"

"github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 66a7607

Please sign in to comment.