Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
build: update to Go 1.17 (#4410)
Browse files Browse the repository at this point in the history
* build: update to Go 1.17

Go 1.17 introduces compiler improvement
(https://golang.org/doc/go1.17#compiler) and supports module graph
pruning (https://golang.org/ref/mod#graph-pruning) and lazy module
loading (https://golang.org/ref/mod#lazy-loading).

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* build: update generated code for Go 1.17

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: regenerating public test cert for TestCertificaterFromCertificateRequest

Reference: #4410 (comment)
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
  • Loading branch information
Juneezee authored Jan 6, 2022
1 parent ce6d63d commit 89b5661
Show file tree
Hide file tree
Showing 16 changed files with 312 additions and 92 deletions.
63 changes: 31 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: go build deps
run: make embed-files-test
- name: golangci-lint
Expand All @@ -59,10 +59,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: go mod tidy
run: make go-mod-tidy
- name: Codegen checks
Expand All @@ -74,10 +74,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: go mod tidy
run: make go-mod-tidy
- name: gomock checks
Expand Down Expand Up @@ -110,10 +110,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Go Build
run: make build-ci

Expand All @@ -136,10 +136,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: go mod tidy
run: make go-mod-tidy
- name: Test
Expand Down Expand Up @@ -169,10 +169,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Test
run: |
touch .env
Expand All @@ -184,7 +184,7 @@ jobs:
name: Scan images for security vulnerabilities
runs-on: ubuntu-latest
needs: build
env:
env:
CTR_TAG: ${{ github.sha }}
CTR_REGISTRY: "localhost:5000"
steps:
Expand All @@ -202,10 +202,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Build docker images
run: make docker-build-osm-controller docker-build-osm-injector docker-build-osm-crds docker-build-osm-bootstrap docker-build-init
- name: Scan docker images for vulnerabilities
Expand Down Expand Up @@ -236,10 +236,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Build test dependencies
run: make docker-build-osm-controller docker-build-osm-injector docker-build-osm-crds docker-build-osm-bootstrap docker-build-init build-osm docker-build-tcp-echo-server
# PR Tests
Expand Down Expand Up @@ -306,10 +306,10 @@ jobs:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}

- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Run Simulation w/ Tresor, SMI policies, egress disabled and reconciler disabled
Expand All @@ -328,7 +328,6 @@ jobs:
./demo/run-osm-demo.sh
go run ./ci/cmd/maestro.go
images:
name: Docker Images
runs-on: ubuntu-latest
Expand All @@ -351,10 +350,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Docker Login
run: docker login --username "$DOCKER_USER" --password-stdin <<< "$DOCKER_PASS"
- name: Push images with git sha tag
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly-images.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Nightly Images
on:
on:
schedule:
- cron: "0 0 * * *"

Expand All @@ -25,10 +25,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Docker Login
run: docker login --username "$DOCKER_USER" --password-stdin <<< "$DOCKER_PASS"
- name: Push images with git sha tag
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/nightly-noinstall.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: OSM NoInstall Nightly Job
on:
on:
workflow_run:
workflows: ["Nightly Images"]
types: [completed]
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
protocol: TCP
- role: worker
EOF
Expand All @@ -50,10 +50,10 @@ jobs:
run: |
kubectl version
kubectl get nodes
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Install OSM via OSM CLI
run: |
make build-osm
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/openshift-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: OpenShift Nightly Job
on:
on:
workflow_run:
workflows: ["Nightly Images"]
types: [completed]
Expand All @@ -24,10 +24,10 @@ jobs:
insecure_skip_tls_verify: true
- name: Test oc
run: oc version --client
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Run e2es
run: |
make build-osm
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
DOCKER_USER: ${{ secrets.RELEASE_DOCKER_USER }}
DOCKER_PASS: ${{ secrets.RELEASE_DOCKER_PASS }}
VERSION: ${{ needs.version.outputs.version }}
BUILD_DATE: '$$(date +%Y-%m-%d-%H:%M)'
BUILD_DATE: "$$(date +%Y-%m-%d-%H:%M)"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -42,10 +42,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Docker Login
run: docker login --username "$DOCKER_USER" --password-stdin <<< "$DOCKER_PASS"
- name: Push images with version tag
Expand Down Expand Up @@ -86,4 +86,4 @@ jobs:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Scan docker images for vulnerabilities
run: make trivy-scan-images
run: make trivy-scan-images
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }}
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Build Binaries
run: |
make release-artifacts
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Windows Nightly Job
on:
on:
workflow_run:
workflows: ["Nightly Images"]
types: [completed]
Expand All @@ -22,10 +22,10 @@ jobs:
method: kubeconfig
kubeconfig: ${{ secrets.CI_WINDOWS_KUBECONFIG }}
id: setcontext
- name: Setup Go 1.16
uses: actions/setup-go@v1
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: Run e2es
run: |
make build-osm
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#build stage
FROM golang:1.16-alpine AS builder
FROM golang:1.17-alpine AS builder

RUN apk update
RUN apk add --no-cache make
Expand Down
2 changes: 1 addition & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## System Requirements
- MacOS, Linux or WSL2 on Windows
- GCC
- Go version [1.16.0 or higher](https://github.com/openservicemesh/osm/issues/2363)
- Go version [1.17.0 or higher](https://github.com/openservicemesh/osm/issues/2363)
- Kubectl version 1.15 or higher
- Docker CLI
- on a Debian based GNU/Linux system: `sudo apt-get install docker`
Expand Down
2 changes: 1 addition & 1 deletion docs/development_guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ OSM leverages [Envoy proxy](https://github.com/envoyproxy/envoy) as a data plane

## Get Go-ing

This Open Service Mesh project uses [Go v1.16.0+](https://golang.org/). If you are not familiar with Go, spend some time with the excellent [Tour of Go](https://tour.golang.org/).
This Open Service Mesh project uses [Go v1.17.0+](https://golang.org/). If you are not familiar with Go, spend some time with the excellent [Tour of Go](https://tour.golang.org/).

## Get the dependencies

Expand Down
Loading

0 comments on commit 89b5661

Please sign in to comment.