Skip to content

Commit

Permalink
bump kpt to go1.20 (#3926)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwenma committed Apr 25, 2023
1 parent 840b078 commit 8e101e6
Show file tree
Hide file tree
Showing 72 changed files with 131 additions and 150 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checkLicenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
- run: |
./scripts/create-licenses.sh
# Upload the licenses list so it's available if needed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2eEnvironment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
- uses: actions/checkout@v3
# Pinned to Commit to ensure action is consistent: https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
# If you upgrade this version confirm the changes match your expectations
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
run: |
which podman
podman version
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -67,10 +67,10 @@ jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -85,10 +85,10 @@ jobs:
# build-windows:
# runs-on: windows-2019
# steps:
# - name: Set up Go 1.19
# - name: Set up Go 1.20
# uses: actions/setup-go@v1
# with:
# go-version: 1.19
# go-version: '1.20'
# id: go
# - name: Check out code into the Go module directory
# uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/live-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
- uses: actions/checkout@master
# Pinned to Commit to ensure action is consistent: https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
# If you upgrade this version confirm the changes match your expectations
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/porch-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
- "kindest/node:v1.23.4@sha256:0e34f0d0fd448aa2f2819cfd74e99fe5793a6e4938b328f657c8e3f81ee0dfb9"

steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
- name: Checkout Porch
uses: actions/checkout@v3
- name: Build kpt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/porch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
name: Porch Unit Tests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
- name: Run Porch Unit Tests
uses: actions/checkout@v3
- name: Verify format / headers etc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verifyContent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
- uses: actions/checkout@v3
- run: |
make build
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

GOLANG_VERSION := 1.19.5
GOLANG_VERSION := 1.20.3
GORELEASER_CONFIG = release/tag/goreleaser.yaml
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GOLANG_VERSION)

Expand Down Expand Up @@ -59,7 +59,7 @@ install-kind:

.PHONY: install-golangci-lint
install-golangci-lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2

.PHONY: install-go-licenses
install-go-licenses:
Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/alphacmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/spf13/cobra"
)

func GetCommand(ctx context.Context, name, version string) *cobra.Command {
func GetCommand(ctx context.Context, _, version string) *cobra.Command {
alpha := &cobra.Command{
Use: "alpha",
Short: alphadocs.AlphaShort,
Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/license/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra"
)

func NewCommand(ctx context.Context, version string) *cobra.Command {
func NewCommand(ctx context.Context, _ string) *cobra.Command {
licenseCmd := &cobra.Command{
Use: "license",
Short: "[Alpha] " + licensedocs.LicenseShort,
Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/license/info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type runner struct {
Command *cobra.Command
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, _ []string) error {
fmt.Println(licenses.AllOSSLicense)
return nil
}
2 changes: 1 addition & 1 deletion commands/alpha/live/plan/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type Runner struct {
output string
}

func (r *Runner) PreRunE(c *cobra.Command, args []string) error {
func (r *Runner) PreRunE(_ *cobra.Command, _ []string) error {
return r.validateOutputFormat()
}

Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/repo/get/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type runner struct {
requestTable bool
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(cmd *cobra.Command, _ []string) error {
outputOption := cmd.Flags().Lookup("output").Value.String()
if strings.Contains(outputOption, "custom-columns") || outputOption == "yaml" || strings.Contains(outputOption, "json") {
r.requestTable = false
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/repo/reg/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type runner struct {
workloadIdentity bool
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"
client, err := porch.CreateClientWithFlags(r.cfg)
if err != nil {
Expand All @@ -96,7 +96,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".runE"

if len(args) == 0 {
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/repo/unreg/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type runner struct {
keepSecret bool
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"
client, err := porch.CreateClientWithFlags(r.cfg)
if err != nil {
Expand All @@ -79,7 +79,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".runE"

if len(args) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/rollouts/advance/advance.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type runner struct {
factory k8scmdutil.Factory
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, args []string) error {
rlc, err := rolloutsclient.New()
if err != nil {
fmt.Printf("%s\n", err)
Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/rollouts/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type runner struct {
factory k8scmdutil.Factory
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(cmd *cobra.Command, _ []string) error {
rlc, err := rolloutsclient.New()
if err != nil {
fmt.Printf("%s\n", err)
Expand Down
6 changes: 1 addition & 5 deletions commands/alpha/rollouts/rolloutsclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ func (rlc *Client) Get(ctx context.Context, ns, name string) (*rolloutsapi.Rollo
}

func (rlc *Client) Update(ctx context.Context, rollout *rolloutsapi.Rollout) error {
if err := rlc.client.Update(ctx, rollout); err != nil {
return err
}

return nil
return rlc.client.Update(ctx, rollout)
}

func useServerSideThrottling(config *rest.Config) *rest.Config {
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/rpkg/approve/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type runner struct {
// Flags
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"

client, err := porch.CreateRESTClient(r.cfg)
Expand All @@ -78,7 +78,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".runE"
var messages []string

Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/rpkg/clone/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type runner struct {
target string // Target package name
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".preRunE"
client, err := porch.CreateClientWithFlags(r.cfg)
if err != nil {
Expand Down Expand Up @@ -183,7 +183,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(cmd *cobra.Command, _ []string) error {
const op errors.Op = command + ".runE"

pr := &porchapi.PackageRevision{
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/rpkg/copy/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type runner struct {
replayStrategy bool
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".preRunE"
client, err := porch.CreateClientWithFlags(r.cfg)
if err != nil {
Expand All @@ -90,7 +90,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(cmd *cobra.Command, _ []string) error {
const op errors.Op = command + ".runE"

revisionSpec, err := r.getPackageRevisionSpec()
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/rpkg/del/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type runner struct {
Command *cobra.Command
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"

client, err := porch.CreateClientWithFlags(r.cfg)
Expand All @@ -79,7 +79,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".runE"
var messages []string

Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/rpkg/get/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ type runner struct {
requestTable bool
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(cmd *cobra.Command, _ []string) error {
// Print the namespace if we're spanning namespaces
if r.getFlags.AllNamespaces {
r.printFlags.HumanReadableFlags.WithNamespace = true
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/rpkg/init/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type runner struct {
workspace string // Target workspace name
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".preRunE"

client, err := porch.CreateClientWithFlags(r.cfg)
Expand Down Expand Up @@ -110,7 +110,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(cmd *cobra.Command, _ []string) error {
const op errors.Op = command + ".runE"

pr := &porchapi.PackageRevision{
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/rpkg/propose/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type runner struct {
// Flags
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"

client, err := porch.CreateClientWithFlags(r.cfg)
Expand All @@ -77,7 +77,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".runE"
var messages []string
namespace := *r.cfg.Namespace
Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/rpkg/proposedelete/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type runner struct {
Command *cobra.Command
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"

client, err := porch.CreateClientWithFlags(r.cfg)
Expand Down
4 changes: 2 additions & 2 deletions commands/alpha/rpkg/pull/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type runner struct {
printer printer.Printer
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"
config, err := r.cfg.ToRESTConfig()
if err != nil {
Expand All @@ -95,7 +95,7 @@ func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
return nil
}

func (r *runner) runE(cmd *cobra.Command, args []string) error {
func (r *runner) runE(_ *cobra.Command, args []string) error {
const op errors.Op = command + ".runE"

if len(args) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion commands/alpha/rpkg/push/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type runner struct {
printer printer.Printer
}

func (r *runner) preRunE(cmd *cobra.Command, args []string) error {
func (r *runner) preRunE(_ *cobra.Command, _ []string) error {
const op errors.Op = command + ".preRunE"
config, err := r.cfg.ToRESTConfig()
if err != nil {
Expand Down
Loading

0 comments on commit 8e101e6

Please sign in to comment.