Skip to content

Commit

Permalink
Merge pull request #121 from acald-creator/upgrade/go/1.19
Browse files Browse the repository at this point in the history
Upgrade to Go 1.19
  • Loading branch information
leecalcote committed Oct 12, 2022
2 parents 79f7679 + 459ccc8 commit e146959
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 810 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Meshery-App-Mesh Build and Releaser
name: Meshery-App Mesh Build and Release
on:
push:
branches:
Expand All @@ -17,7 +17,7 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@master
with:
go-version: ${{ secrets.GO_VERSION }}
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build .
Expand Down
52 changes: 32 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Meshery-app-mesh
name: Default Meshery-App Mesh Workflow
on:
push:
branches:
Expand All @@ -13,15 +13,24 @@ jobs:
name: Check & Review code
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- uses: actions/setup-go@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
go-version: 1.19
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
go-version: 1.17
- run: GOPROXY=direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./appmesh/... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
error_check:
name: Error check
runs-on: ubuntu-latest
Expand All @@ -31,23 +40,26 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@master
with:
go-version: 1.17
go-version: 1.19
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -tags draft ./...
static_check:
name: Static check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.17
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck; /home/runner/go/bin/staticcheck -tags draft -checks all ./appmesh/... # https://staticcheck.io/docs/checks
go-version: 1.19
- uses: dominikh/[email protected]
with:
install-go: false
version: "2022.1"
vet:
name: Vet
runs-on: ubuntu-latest
Expand All @@ -57,9 +69,9 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@master
with:
go-version: 1.17
go-version: 1.19
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./...
sec_check:
name: Security check
Expand All @@ -68,7 +80,7 @@ jobs:
GO111MODULE: on
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Run Gosec Security Scanner
Expand All @@ -87,13 +99,13 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@master
with:
go-version: 1.17
go-version: 1.19
- name: Create cluster using KinD
uses: engineerd/setup-kind@v0.3.0
uses: engineerd/setup-kind@v0.5.0
with:
version: "v0.7.0"
version: "v0.11.0"
- run: |
export CURRENTCONTEXT="$(kubectl config current-context)"
echo "current-context:" ${CURRENTCONTEXT}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/component-generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
token: ${{ secrets.GH_ACCESS_TOKEN }}
ref: "master"
- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@master
with:
go-version: 1.17
go-version: 1.19
- name: Run adapter to create components
run: |
touch log.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/error-ref-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
if: github.repository == 'meshery/meshery-app-mesh'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@master
# token here with write access to meshery-app-mesh repo
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
ref: 'master'

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@master
with:
go-version: 1.17
go-version: 1.19

- name: Run utility
run: |
Expand All @@ -40,7 +40,7 @@ jobs:

# to push changes to meshery docs
- name: Checkout meshery
uses: actions/checkout@v2
uses: actions/checkout@master
with:
repository: 'meshery/meshery'
# token with write access to meshery repository
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17 as builder
FROM golang:1.19 as builder

ARG VERSION
ARG GIT_COMMITSHA
Expand Down
18 changes: 4 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,20 @@ include build/Makefile.show-help.mk
# Environment Setup
#-----------------------------------------------------------------------------
BUILDER=buildx-multi-arch
ADAPTER=meshery-app-mesh
ADAPTER=app-mesh

v ?= 1.17.8 # Default go version to be used
v ?= 1.19.1 # Default go version to be used


#-----------------------------------------------------------------------------
# Docker-based Builds
#-----------------------------------------------------------------------------
.PHONY: docker docker-run lint proto-setup proto error test run run-force-dynamic-reg

.PHONY: docker docker-run lint error test run run-force-dynamic-reg

## Lint check Golang
lint:
golangci-lint run

## Retrieve protos
proto-setup:
cd meshes
wget https://raw.githubusercontent.com/layer5io/meshery/master/meshes/meshops.proto

## Generate protos
proto:
protoc -I meshes/ meshes/meshops.proto --go_out=plugins=grpc:./meshes/

## Build Adapter container image with "edge-latest" tag
docker:
DOCKER_BUILDKIT=1 docker build -t layer5/meshery-$(ADAPTER):$(RELEASE_CHANNEL)-latest .
Expand All @@ -57,7 +47,7 @@ docker-run:

## Build and run Adapter locally
run:
go$(v) mod tidy -compat=1.17; \
go$(v) mod tidy; \
DEBUG=true GOPROXY=direct GOSUMDB=off go run main.go

## Build and run Adapter locally; force component registration
Expand Down
2 changes: 1 addition & 1 deletion build/Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GIT_VERSION = $(shell git describe --tags `git rev-list --tags --max-count=1`)
GIT_COMMITSHA = $(shell git rev-list -1 HEAD)
GIT_STRIPPED_VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1` | cut -c 2-)

GOVERSION = 1.17.8
GOVERSION = 1.19.1
GOPATH = $(shell go env GOPATH)
GOBIN = $(GOPATH)/bin

Expand Down
6 changes: 1 addition & 5 deletions build/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var AllVersions []string

const Component = "APP_MESH"

//NewConfig creates the configuration for creating components
// NewConfig creates the configuration for creating components
func NewConfig(version string) manifests.Config {
return manifests.Config{
Name: smp.ServiceMesh_Type_name[int32(smp.ServiceMesh_APP_MESH)],
Expand All @@ -34,10 +34,6 @@ func NewConfig(version string) manifests.Config {
SpecPath: "spec.versions[0].schema.openAPIV3Schema.properties.spec"}, false),
ExtractCrds: func(manifest string) []string {
crds := strings.Split(manifest, "---")
// trim the spaces
for _, crd := range crds {
crd = strings.TrimSpace(crd)
}
return crds
},
}
Expand Down
Loading

0 comments on commit e146959

Please sign in to comment.