From 3524cb01c16dc31c40614e907bd29901652dd16f Mon Sep 17 00:00:00 2001 From: Charles Guertin Date: Tue, 12 Dec 2023 19:38:41 -0500 Subject: [PATCH] use github sdk v57. --- go.mod | 3 --- go.sum | 6 +----- pkg/github/client.go | 2 +- pkg/github/mocks/mock_client.go | 2 +- pkg/updater/operations.go | 4 ++-- pkg/updater/operations_test.go | 5 +++-- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 63727e0..1d9d05c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.20 require ( github.com/cguertin14/logger v1.0.6 github.com/golang/mock v1.6.0 - github.com/google/go-github/v43 v43.0.0 github.com/google/go-github/v57 v57.0.0 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.1 @@ -16,7 +15,6 @@ require ( require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -33,7 +31,6 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect - golang.org/x/crypto v0.16.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/go.sum b/go.sum index 1223b2f..6523ef2 100644 --- a/go.sum +++ b/go.sum @@ -16,9 +16,7 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v43 v43.0.0 h1:y+GL7LIsAIF2NZlJ46ZoC/D1W1ivZasT0lnWHMYPZ+U= -github.com/google/go-github/v43 v43.0.0/go.mod h1:ZkTvvmCXBvsfPpTHXnH/d2hP9Y0cTbvN9kr5xqyXOIc= +github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -74,8 +72,6 @@ go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= diff --git a/pkg/github/client.go b/pkg/github/client.go index a690d83..bc3e942 100644 --- a/pkg/github/client.go +++ b/pkg/github/client.go @@ -3,7 +3,7 @@ package legacy import ( "context" - "github.com/google/go-github/v43/github" + "github.com/google/go-github/v57/github" "golang.org/x/oauth2" ) diff --git a/pkg/github/mocks/mock_client.go b/pkg/github/mocks/mock_client.go index 9f4f373..f5a5453 100644 --- a/pkg/github/mocks/mock_client.go +++ b/pkg/github/mocks/mock_client.go @@ -10,7 +10,7 @@ import ( legacy "github.com/cguertin14/k3supdater/pkg/github" gomock "github.com/golang/mock/gomock" - github "github.com/google/go-github/v43/github" + github "github.com/google/go-github/v57/github" ) // MockClient is a mock of Client interface. diff --git a/pkg/updater/operations.go b/pkg/updater/operations.go index 7a9124a..4a6299a 100644 --- a/pkg/updater/operations.go +++ b/pkg/updater/operations.go @@ -10,7 +10,7 @@ import ( legacy "github.com/cguertin14/k3supdater/pkg/github" "github.com/cguertin14/logger" - "github.com/google/go-github/v43/github" + "github.com/google/go-github/v57/github" "golang.org/x/mod/semver" ) @@ -196,7 +196,7 @@ func (c *ClientSet) updateFile(ctx context.Context, req updateFileReq) (err erro Committer: &github.CommitAuthor{ Name: github.String("k3supdater-bot"), Email: github.String("k3supdater-bot@k3s.io"), - Date: &now, + Date: &github.Timestamp{Time: now}, }, Message: github.String( fmt.Sprintf("Updated k3s version %s to %s.", req.currentVersion, *req.latestRelease.Name), diff --git a/pkg/updater/operations_test.go b/pkg/updater/operations_test.go index 3aec816..e84f698 100644 --- a/pkg/updater/operations_test.go +++ b/pkg/updater/operations_test.go @@ -1,4 +1,5 @@ -//+build test +//go:build test +// +build test package updater @@ -11,7 +12,7 @@ import ( github_mocks "github.com/cguertin14/k3supdater/pkg/github/mocks" "github.com/golang/mock/gomock" - "github.com/google/go-github/v43/github" + "github.com/google/go-github/v57/github" ) func TestUpdateK3sRelease(t *testing.T) {