Skip to content

Commit

Permalink
VZ-11451: Build ingress controller v1.3.1 using Go 1.20.10 (#15)
Browse files Browse the repository at this point in the history
* Build images using Go 1.20.10
  • Loading branch information
bhatpmk authored Nov 17, 2023
1 parent e4855c8 commit 9e99d0c
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 154 deletions.
12 changes: 9 additions & 3 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ DEFAULT_BACKEND_IMAGE=${DOCKER_REPO}/${DOCKER_NAMESPACE}/${BACKEND_IMAGE_NAME}
CONTROLLER_IMAGE=${DOCKER_REPO}/${DOCKER_NAMESPACE}/${CONTROLLER_IMAGE_NAME}
WEBHOOK_CERTGEN_IMAGE=${DOCKER_REPO}/${DOCKER_NAMESPACE}/${WEBHOOK_CERTGEN_IMAGE_NAME}

# Define custom Golang image
GO_CONTAINER_IMAGE=${GOLANG_IMAGE_NAME:-ghcr.io/verrazzano/golang:v1.20.10}

# Use the latest runner image from controller-v1.9.4, as a workaround to build cmd/dbg, cmd/waitshutdown and cmd/waitshutdown with Go 1.21.3
RUNNER_IMAGE=registry.k8s.io/ingress-nginx/e2e-test-runner:v20231011-8b53cabe0@sha256:ed0dad805c635e66469b4ac376010eebdd0b3fe62d753f58db1632d6f12f451d

set -ue

mkdir -p ${GOPATH}/src/k8s.io
Expand All @@ -31,22 +37,22 @@ docker push ${INGRESS_NGINX_DOCKER_IMAGE_AMD64}
# Build custom-error-pages and its modules from source
mkdir -p images/custom-error-pages/rootfs/stage-licenses
cp LICENSE README.md THIRD_PARTY_LICENSES.txt images/custom-error-pages/rootfs/stage-licenses
make build -e BASEIMAGE=${INGRESS_NGINX_DOCKER_IMAGE_AMD64} -e TAG=${DOCKER_TAG} -e REGISTRY=${DOCKER_REPO}/${DOCKER_NAMESPACE} -C images/custom-error-pages/
make build -e BASEIMAGE=${INGRESS_NGINX_DOCKER_IMAGE_AMD64} -e TAG=${DOCKER_TAG} -e REGISTRY=${DOCKER_REPO}/${DOCKER_NAMESPACE} -e GO_CONTAINER_IMAGE=${GO_CONTAINER_IMAGE} -C images/custom-error-pages/
rm -fr images/custom-error-pages/rootfs/stage-licenses

# Push the custom-error-pages image
docker tag ${DOCKER_REPO}/${DOCKER_NAMESPACE}/nginx-errors:${DOCKER_TAG} ${DEFAULT_BACKEND_IMAGE}:${DOCKER_TAG}
docker push ${DEFAULT_BACKEND_IMAGE}:${DOCKER_TAG}

# Create the nginx-ingress-controller image
make ARCH=amd64 build image -e BASE_IMAGE=${INGRESS_NGINX_DOCKER_IMAGE_AMD64} -e TAG=${DOCKER_TAG} -e REGISTRY=${DOCKER_REPO}/${DOCKER_NAMESPACE} DOCKER_IN_DOCKER_ENABLED=false
make ARCH=amd64 build image -e BASE_IMAGE=${INGRESS_NGINX_DOCKER_IMAGE_AMD64} -e TAG=${DOCKER_TAG} -e REGISTRY=${DOCKER_REPO}/${DOCKER_NAMESPACE} DOCKER_IN_DOCKER_ENABLED=false -e E2E_IMAGE=${RUNNER_IMAGE}
docker tag ${DOCKER_REPO}/${DOCKER_NAMESPACE}/controller:${DOCKER_TAG} ${CONTROLLER_IMAGE}:${DOCKER_TAG}
docker push ${CONTROLLER_IMAGE}:${DOCKER_TAG}

# Build the kube-webhook-certgen image and push it
mkdir -p images/kube-webhook-certgen/rootfs/stage-licenses
cp LICENSE README.md THIRD_PARTY_LICENSES.txt images/kube-webhook-certgen/rootfs/stage-licenses
make build -e TAG=${DOCKER_TAG} -e REGISTRY=${DOCKER_REPO}/${DOCKER_NAMESPACE} -C images/kube-webhook-certgen/
make build -e TAG=${DOCKER_TAG} -e REGISTRY=${DOCKER_REPO}/${DOCKER_NAMESPACE} -e GO_CONTAINER_IMAGE=${GO_CONTAINER_IMAGE} -C images/kube-webhook-certgen/
rm -fr images/kube-webhook-certgen/rootfs/stage-licenses

docker tag ${DOCKER_REPO}/${DOCKER_NAMESPACE}/kube-webhook-certgen:${DOCKER_TAG} ${WEBHOOK_CERTGEN_IMAGE}:${DOCKER_TAG}
Expand Down
20 changes: 11 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/moul/pb v0.0.0-20220425114252-bca18df4138c
github.com/ncabatoff/process-exporter v0.7.10
github.com/onsi/ginkgo/v2 v2.1.4
github.com/opencontainers/runc v1.1.4
github.com/opencontainers/runc v1.1.5
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v1.13.0
github.com/prometheus/client_model v0.2.0
Expand All @@ -25,8 +25,8 @@ require (
github.com/stretchr/testify v1.8.0
github.com/yudai/gojsondiff v1.0.0
github.com/zakjan/cert-chain-resolver v0.0.0-20211122211144-c6b0b792af9a
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
golang.org/x/net v0.1.1-0.20221104162952-702349b0e862
golang.org/x/crypto v0.14.0
golang.org/x/net v0.17.0
google.golang.org/grpc v1.49.0
gopkg.in/go-playground/pool.v3 v3.1.1
gopkg.in/mcuadros/go-syslog.v2 v2.3.0
Expand Down Expand Up @@ -59,7 +59,7 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
Expand Down Expand Up @@ -105,13 +105,13 @@ require (
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.1.12 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
google.golang.org/protobuf v1.28.1 // indirect
Expand All @@ -128,3 +128,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace golang.org/x/net => golang.org/x/net v0.17.0
Loading

0 comments on commit 9e99d0c

Please sign in to comment.