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

Commit

Permalink
Move to go 1.17 (#2929)
Browse files Browse the repository at this point in the history
* Move to go 1.17

Signed-off-by: Sam Foo <foos@vmware.com>

* Fix func literals used in errgroups

Signed-off-by: Sam Foo <foos@vmware.com>

* Add go build tags

Signed-off-by: Sam Foo <foos@vmware.com>
  • Loading branch information
Sam Foo committed Oct 6, 2021
1 parent 3c89689 commit f6535a3
Show file tree
Hide file tree
Showing 128 changed files with 263 additions and 5,027 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/electron.yaml
Expand Up @@ -19,7 +19,7 @@ jobs:
cache-dependency-path: 'web/package-lock.json'
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Build binary
env:
GOFLAGS: -mod=vendor
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: go vet
env:
GOFLAGS: -mod=vendor
Expand All @@ -34,7 +34,7 @@ jobs:
cache-dependency-path: 'web/package-lock.json'
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: eslint
run: |
go run build.go web-lint
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yaml
Expand Up @@ -18,7 +18,7 @@ jobs:
cache-dependency-path: 'web/package-lock.json'
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Build web assets
run: |
go run build.go web-build
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
name: Run goreleaser
needs: [nightly-build]
runs-on: ubuntu-latest
container: goreleaser/goreleaser:v0.174.2
container: goreleaser/goreleaser:v0.180.3
steps:
- uses: actions/checkout@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/preflight-checks.yaml
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.16.x
- 1.17.x
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
name: Golang tests on ${{ matrix.platform }}
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- uses: actions/checkout@v2
- name: Get tag
run: echo "GITHUB_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.16.x
- 1.17.x
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
name: Build on ${{ matrix.platform }}
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
needs: [bundle_assets, verify_tag]
runs-on: ubuntu-latest
container: goreleaser/goreleaser:v0.174.2
container: goreleaser/goreleaser:v0.180.3
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-generated.yaml
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Install libraries
run: sudo apt-get update && sudo apt install -y libgpgme-dev libassuan-dev libdevmapper-dev libbtrfs-dev
- name: Checkout code
Expand Down
104 changes: 103 additions & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/vmware-tanzu/octant

go 1.16
go 1.17

require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
Expand Down Expand Up @@ -55,3 +55,105 @@ require (
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
sigs.k8s.io/yaml v1.3.0
)

require (
cloud.google.com/go v0.93.3 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.12 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.5 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.0 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/Microsoft/hcsshim v0.8.20 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.2.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/containerd/cgroups v1.0.1 // indirect
github.com/containerd/containerd v1.5.1 // indirect
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b // indirect
github.com/containers/ocicrypt v1.1.2 // indirect
github.com/containers/storage v1.32.6 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-intervals v0.0.2 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/klauspost/compress v1.13.1 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6 // indirect
github.com/opencontainers/runc v1.0.0 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/opencontainers/selinux v1.8.2 // indirect
github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.7.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tchap/go-patricia v2.3.0+incompatible // indirect
github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vbatts/tar-split v0.11.1 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.56.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/klog/v2 v2.8.0 // indirect
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
)
9 changes: 5 additions & 4 deletions internal/objectvisitor/mutatingwebhookconfiguration.go
Expand Up @@ -35,7 +35,7 @@ func NewMutatingWebhookConfiguration(os store.Store) *MutatingWebhookConfigurati
}
}

// Support returns the gvk this typed visitor supports.
// Supports returns the gvk this typed visitor supports.
func (p *MutatingWebhookConfiguration) Supports() schema.GroupVersionKind {
return gvk.MutatingWebhookConfiguration
}
Expand All @@ -59,14 +59,15 @@ func (p *MutatingWebhookConfiguration) Visit(ctx context.Context, object *unstru

g.Go(func() error {
for _, mutatingwebhook := range mutatingwebhookconfiguration.Webhooks {
mw := mutatingwebhook
g.Go(func() error {
if mutatingwebhook.ClientConfig.Service == nil {
if mw.ClientConfig.Service == nil {
return nil
}

key := store.KeyFromGroupVersionKind(gvk.Service)
key.Namespace = mutatingwebhook.ClientConfig.Service.Namespace
key.Name = mutatingwebhook.ClientConfig.Service.Name
key.Namespace = mw.ClientConfig.Service.Namespace
key.Name = mw.ClientConfig.Service.Name
service, err := p.objectStore.Get(ctx, key)
if err != nil {
if kerrors.IsNotFound(err) {
Expand Down
9 changes: 5 additions & 4 deletions internal/objectvisitor/validatingwebhookconfiguration.go
Expand Up @@ -35,7 +35,7 @@ func NewValidatingWebhookConfiguration(os store.Store) *ValidatingWebhookConfigu
}
}

// Support returns the gvk this typed visitor supports.
// Supports returns the gvk this typed visitor supports.
func (p *ValidatingWebhookConfiguration) Supports() schema.GroupVersionKind {
return gvk.ValidatingWebhookConfiguration
}
Expand All @@ -59,14 +59,15 @@ func (p *ValidatingWebhookConfiguration) Visit(ctx context.Context, object *unst

g.Go(func() error {
for _, validatingwebhook := range validatingwebhookconfiguration.Webhooks {
vw := validatingwebhook
g.Go(func() error {
if validatingwebhook.ClientConfig.Service == nil {
if vw.ClientConfig.Service == nil {
return nil
}

key := store.KeyFromGroupVersionKind(gvk.Service)
key.Namespace = validatingwebhook.ClientConfig.Service.Namespace
key.Name = validatingwebhook.ClientConfig.Service.Name
key.Namespace = vw.ClientConfig.Service.Namespace
key.Name = vw.ClientConfig.Service.Name
service, err := p.objectStore.Get(ctx, key)
if err != nil {
if kerrors.IsNotFound(err) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/websockets/websocket_client.go
Expand Up @@ -193,8 +193,9 @@ func handleStreamingMessage(client api.StreamingClient, request api.StreamReques
var g errgroup.Group

for _, handler := range handlers {
h := handler
g.Go(func() error {
return handler.Handler(client.State(), request.Payload)
return h.Handler(client.State(), request.Payload)
})
}

Expand Down
1 change: 1 addition & 0 deletions pkg/plugin/plugincmd_unix.go
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/plugin/plugincmd_windows.go
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
8 changes: 0 additions & 8 deletions vendor/contrib.go.opencensus.io/exporter/jaeger/go.mod

This file was deleted.

0 comments on commit f6535a3

Please sign in to comment.