From 8e101e6fe15d0e5868ddec24325da61809c2bae5 Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Mon, 24 Apr 2023 17:34:51 -0700 Subject: [PATCH] bump kpt to go1.20 (#3926) --- .github/workflows/checkLicenses.yml | 4 +-- .github/workflows/e2eEnvironment.yml | 2 +- .github/workflows/go.yml | 12 ++++---- .github/workflows/live-e2e.yml | 2 +- .github/workflows/porch-e2e.yml | 4 +-- .github/workflows/porch.yml | 4 +-- .github/workflows/release.yml | 2 +- .github/workflows/verifyContent.yml | 2 +- Makefile | 4 +-- commands/alpha/alphacmd.go | 2 +- commands/alpha/license/command.go | 2 +- commands/alpha/license/info/info.go | 2 +- commands/alpha/live/plan/command.go | 2 +- commands/alpha/repo/get/command.go | 2 +- commands/alpha/repo/reg/command.go | 4 +-- commands/alpha/repo/unreg/command.go | 4 +-- commands/alpha/rollouts/advance/advance.go | 2 +- commands/alpha/rollouts/get/get.go | 2 +- .../alpha/rollouts/rolloutsclient/client.go | 6 +--- commands/alpha/rpkg/approve/command.go | 4 +-- commands/alpha/rpkg/clone/command.go | 4 +-- commands/alpha/rpkg/copy/command.go | 4 +-- commands/alpha/rpkg/del/command.go | 4 +-- commands/alpha/rpkg/get/command.go | 2 +- commands/alpha/rpkg/init/command.go | 4 +-- commands/alpha/rpkg/propose/command.go | 4 +-- commands/alpha/rpkg/proposedelete/command.go | 2 +- commands/alpha/rpkg/pull/command.go | 4 +-- commands/alpha/rpkg/push/command.go | 2 +- commands/alpha/rpkg/reject/command.go | 4 +-- commands/alpha/rpkg/update/command.go | 2 +- commands/alpha/sync/create/command.go | 4 +-- commands/alpha/sync/delete/command.go | 9 ++---- commands/alpha/sync/get/command.go | 2 +- commands/alpha/wasm/pull/command.go | 2 +- commands/alpha/wasm/push/command.go | 2 +- commands/alpha/wasm/wasmcmd.go | 2 +- commands/fn/render/cmdrender.go | 4 +-- commands/pkg/diff/cmddiff.go | 2 +- commands/pkg/get/cmdget.go | 2 +- commands/pkg/get/cmdget_test.go | 2 +- commands/pkg/init/cmdinit.go | 2 +- commands/pkg/update/cmdupdate.go | 2 +- commands/pkg/update/cmdupdate_test.go | 2 +- dogfood/sitev2/go.mod | 2 +- go.mod | 13 ++++---- go.sum | 30 +++++++------------ healthcheck/go.mod | 2 +- internal/alpha/printers/table/collector.go | 2 +- internal/fnruntime/container.go | 2 +- internal/util/get/example_test.go | 13 ++++---- internal/util/porch/approval.go | 7 ++--- pkg/fn/multiruntime.go | 4 +-- pkg/oci/cache.go | 2 +- porch/api/go.mod | 2 +- porch/build/Dockerfile.apiserver | 2 +- porch/build/Dockerfile.etcd | 2 +- porch/build/Dockerfile.porch | 2 +- porch/controllers/Dockerfile | 2 +- porch/docs/running-locally.md | 2 +- porch/examples/apps/hello-server/Dockerfile | 2 +- porch/examples/apps/hello-server/go.mod | 2 +- porch/func/Dockerfile | 2 +- porch/func/Dockerfile-wrapperserver | 2 +- porch/go.mod | 12 ++++---- porch/go.sum | 19 ++++++------ porch/test/Dockerfile | 2 +- release/formula/main.go | 2 +- rollouts/Dockerfile | 2 +- rollouts/docs/running-locally.md | 2 +- rollouts/go.mod | 2 +- tools/licensescan/go.mod | 2 +- 72 files changed, 131 insertions(+), 150 deletions(-) diff --git a/.github/workflows/checkLicenses.yml b/.github/workflows/checkLicenses.yml index f2cd1ab958..bfe36fec5c 100644 --- a/.github/workflows/checkLicenses.yml +++ b/.github/workflows/checkLicenses.yml @@ -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 diff --git a/.github/workflows/e2eEnvironment.yml b/.github/workflows/e2eEnvironment.yml index b665c24bc1..4d490489d7 100644 --- a/.github/workflows/e2eEnvironment.yml +++ b/.github/workflows/e2eEnvironment.yml @@ -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 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c57e4e9814..1b6d49e5eb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/live-e2e.yml b/.github/workflows/live-e2e.yml index b318418b92..430af7c87f 100644 --- a/.github/workflows/live-e2e.yml +++ b/.github/workflows/live-e2e.yml @@ -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 diff --git a/.github/workflows/porch-e2e.yml b/.github/workflows/porch-e2e.yml index f008b539b4..c0362be2be 100644 --- a/.github/workflows/porch-e2e.yml +++ b/.github/workflows/porch-e2e.yml @@ -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 diff --git a/.github/workflows/porch.yml b/.github/workflows/porch.yml index 6cbc4c48e7..1bf5564964 100644 --- a/.github/workflows/porch.yml +++ b/.github/workflows/porch.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6052ab33fc..fa041959cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/.github/workflows/verifyContent.yml b/.github/workflows/verifyContent.yml index a191757f00..341fa4db9a 100644 --- a/.github/workflows/verifyContent.yml +++ b/.github/workflows/verifyContent.yml @@ -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 diff --git a/Makefile b/Makefile index 0f4ee1ac14..6654c7d991 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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: diff --git a/commands/alpha/alphacmd.go b/commands/alpha/alphacmd.go index 910a2591d1..0a5ee9bced 100644 --- a/commands/alpha/alphacmd.go +++ b/commands/alpha/alphacmd.go @@ -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, diff --git a/commands/alpha/license/command.go b/commands/alpha/license/command.go index 52f5ce353a..e22c6127ad 100644 --- a/commands/alpha/license/command.go +++ b/commands/alpha/license/command.go @@ -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, diff --git a/commands/alpha/license/info/info.go b/commands/alpha/license/info/info.go index 39945c3b59..aa103fdbbb 100644 --- a/commands/alpha/license/info/info.go +++ b/commands/alpha/license/info/info.go @@ -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 } diff --git a/commands/alpha/live/plan/command.go b/commands/alpha/live/plan/command.go index f4994b39ea..f280ba8f52 100644 --- a/commands/alpha/live/plan/command.go +++ b/commands/alpha/live/plan/command.go @@ -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() } diff --git a/commands/alpha/repo/get/command.go b/commands/alpha/repo/get/command.go index 9ba508e3ee..da62311a8d 100644 --- a/commands/alpha/repo/get/command.go +++ b/commands/alpha/repo/get/command.go @@ -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 diff --git a/commands/alpha/repo/reg/command.go b/commands/alpha/repo/reg/command.go index 8851bae691..df1c5c6255 100644 --- a/commands/alpha/repo/reg/command.go +++ b/commands/alpha/repo/reg/command.go @@ -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 { @@ -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 { diff --git a/commands/alpha/repo/unreg/command.go b/commands/alpha/repo/unreg/command.go index f27b6d72e0..e498e6c951 100644 --- a/commands/alpha/repo/unreg/command.go +++ b/commands/alpha/repo/unreg/command.go @@ -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 { @@ -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 { diff --git a/commands/alpha/rollouts/advance/advance.go b/commands/alpha/rollouts/advance/advance.go index 97510236da..82d6af601a 100644 --- a/commands/alpha/rollouts/advance/advance.go +++ b/commands/alpha/rollouts/advance/advance.go @@ -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) diff --git a/commands/alpha/rollouts/get/get.go b/commands/alpha/rollouts/get/get.go index 087afddcba..308147b816 100644 --- a/commands/alpha/rollouts/get/get.go +++ b/commands/alpha/rollouts/get/get.go @@ -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) diff --git a/commands/alpha/rollouts/rolloutsclient/client.go b/commands/alpha/rollouts/rolloutsclient/client.go index c8e0046cdf..d61b77d7ac 100644 --- a/commands/alpha/rollouts/rolloutsclient/client.go +++ b/commands/alpha/rollouts/rolloutsclient/client.go @@ -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 { diff --git a/commands/alpha/rpkg/approve/command.go b/commands/alpha/rpkg/approve/command.go index b9bfac74b0..ebfd0d63a5 100644 --- a/commands/alpha/rpkg/approve/command.go +++ b/commands/alpha/rpkg/approve/command.go @@ -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) @@ -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 diff --git a/commands/alpha/rpkg/clone/command.go b/commands/alpha/rpkg/clone/command.go index 6df727dc59..5c206055f7 100644 --- a/commands/alpha/rpkg/clone/command.go +++ b/commands/alpha/rpkg/clone/command.go @@ -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 { @@ -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{ diff --git a/commands/alpha/rpkg/copy/command.go b/commands/alpha/rpkg/copy/command.go index 81ae678363..188d521ed7 100644 --- a/commands/alpha/rpkg/copy/command.go +++ b/commands/alpha/rpkg/copy/command.go @@ -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 { @@ -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() diff --git a/commands/alpha/rpkg/del/command.go b/commands/alpha/rpkg/del/command.go index 166061a9e6..378c1abb64 100644 --- a/commands/alpha/rpkg/del/command.go +++ b/commands/alpha/rpkg/del/command.go @@ -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) @@ -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 diff --git a/commands/alpha/rpkg/get/command.go b/commands/alpha/rpkg/get/command.go index dc825348da..33f4c5230f 100644 --- a/commands/alpha/rpkg/get/command.go +++ b/commands/alpha/rpkg/get/command.go @@ -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 diff --git a/commands/alpha/rpkg/init/command.go b/commands/alpha/rpkg/init/command.go index f7b2830141..3122c5e863 100644 --- a/commands/alpha/rpkg/init/command.go +++ b/commands/alpha/rpkg/init/command.go @@ -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) @@ -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{ diff --git a/commands/alpha/rpkg/propose/command.go b/commands/alpha/rpkg/propose/command.go index 6d36c56e16..a8121dfb8c 100644 --- a/commands/alpha/rpkg/propose/command.go +++ b/commands/alpha/rpkg/propose/command.go @@ -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) @@ -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 diff --git a/commands/alpha/rpkg/proposedelete/command.go b/commands/alpha/rpkg/proposedelete/command.go index da49ab54cd..1709eb0ae5 100644 --- a/commands/alpha/rpkg/proposedelete/command.go +++ b/commands/alpha/rpkg/proposedelete/command.go @@ -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) diff --git a/commands/alpha/rpkg/pull/command.go b/commands/alpha/rpkg/pull/command.go index 5a8e457c75..7515cf6ec9 100644 --- a/commands/alpha/rpkg/pull/command.go +++ b/commands/alpha/rpkg/pull/command.go @@ -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 { @@ -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 { diff --git a/commands/alpha/rpkg/push/command.go b/commands/alpha/rpkg/push/command.go index b11defa285..3e83cf4529 100644 --- a/commands/alpha/rpkg/push/command.go +++ b/commands/alpha/rpkg/push/command.go @@ -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 { diff --git a/commands/alpha/rpkg/reject/command.go b/commands/alpha/rpkg/reject/command.go index cd1ed2ac86..8f7afdabc5 100644 --- a/commands/alpha/rpkg/reject/command.go +++ b/commands/alpha/rpkg/reject/command.go @@ -68,7 +68,7 @@ type runner struct { // Flags } -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" if len(args) < 1 { @@ -89,7 +89,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 diff --git a/commands/alpha/rpkg/update/command.go b/commands/alpha/rpkg/update/command.go index b0ecdc8a40..1cba69e944 100644 --- a/commands/alpha/rpkg/update/command.go +++ b/commands/alpha/rpkg/update/command.go @@ -74,7 +74,7 @@ type runner struct { prs []porchapi.PackageRevision } -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" c, err := porch.CreateClientWithFlags(r.cfg) if err != nil { diff --git a/commands/alpha/sync/create/command.go b/commands/alpha/sync/create/command.go index fcdf07ae50..31c8fb3046 100644 --- a/commands/alpha/sync/create/command.go +++ b/commands/alpha/sync/create/command.go @@ -71,7 +71,7 @@ type runner struct { syncPkg string } -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" if len(args) == 0 { @@ -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(_ *cobra.Command, args []string) error { const op errors.Op = command + ".runE" syncName := args[0] diff --git a/commands/alpha/sync/delete/command.go b/commands/alpha/sync/delete/command.go index dd4c2dd16a..5718234f41 100644 --- a/commands/alpha/sync/delete/command.go +++ b/commands/alpha/sync/delete/command.go @@ -91,7 +91,7 @@ type runner struct { timeout time.Duration } -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.CreateDynamicClient(r.cfg) if err != nil { @@ -101,7 +101,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 { @@ -151,10 +151,7 @@ func (r *runner) runE(cmd *cobra.Command, args []string) error { } fmt.Println("Waiting for deleted resources to be removed..") - if err := r.waitForResourceGroup(ctx, name, namespace); err != nil { - return err - } - return nil + return r.waitForResourceGroup(ctx, name, namespace) }(); err != nil { // TODO: See if we can expose more information here about what might have prevented a package // from being deleted. diff --git a/commands/alpha/sync/get/command.go b/commands/alpha/sync/get/command.go index 4b11377bde..5ae7a26f30 100644 --- a/commands/alpha/sync/get/command.go +++ b/commands/alpha/sync/get/command.go @@ -71,7 +71,7 @@ type runner struct { printFlags *get.PrintFlags } -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.CreateDynamicClient(r.cfg) if err != nil { diff --git a/commands/alpha/wasm/pull/command.go b/commands/alpha/wasm/pull/command.go index c98be05ec6..834f3724a6 100644 --- a/commands/alpha/wasm/pull/command.go +++ b/commands/alpha/wasm/pull/command.go @@ -55,7 +55,7 @@ type runner struct { storageClient *wasm.Client } -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) != 2 { diff --git a/commands/alpha/wasm/push/command.go b/commands/alpha/wasm/push/command.go index 5d0b6dbb6e..6ac331a0ab 100644 --- a/commands/alpha/wasm/push/command.go +++ b/commands/alpha/wasm/push/command.go @@ -55,7 +55,7 @@ type runner struct { storageClient *wasm.Client } -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) != 2 { diff --git a/commands/alpha/wasm/wasmcmd.go b/commands/alpha/wasm/wasmcmd.go index fe09560b21..397991db16 100644 --- a/commands/alpha/wasm/wasmcmd.go +++ b/commands/alpha/wasm/wasmcmd.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/cobra" ) -func NewCommand(ctx context.Context, version string) *cobra.Command { +func NewCommand(ctx context.Context, _ string) *cobra.Command { wasmcmd := &cobra.Command{ Use: "wasm", Short: "[Alpha] " + wasmdocs.WasmShort, diff --git a/commands/fn/render/cmdrender.go b/commands/fn/render/cmdrender.go index a8c276ffa3..64a7fe0bc6 100644 --- a/commands/fn/render/cmdrender.go +++ b/commands/fn/render/cmdrender.go @@ -85,7 +85,7 @@ func (r *Runner) InitDefaults() { r.RunnerOptions.InitDefaults() } -func (r *Runner) preRunE(c *cobra.Command, args []string) error { +func (r *Runner) preRunE(_ *cobra.Command, args []string) error { if len(args) == 0 { // no pkg path specified, default to current working dir wd, err := os.Getwd() @@ -116,7 +116,7 @@ func (r *Runner) preRunE(c *cobra.Command, args []string) error { return nil } -func (r *Runner) runE(c *cobra.Command, _ []string) error { +func (r *Runner) runE(_ *cobra.Command, _ []string) error { var output io.Writer outContent := bytes.Buffer{} if r.dest != "" { diff --git a/commands/pkg/diff/cmddiff.go b/commands/pkg/diff/cmddiff.go index 4b76031cd1..780b505c3a 100644 --- a/commands/pkg/diff/cmddiff.go +++ b/commands/pkg/diff/cmddiff.go @@ -117,6 +117,6 @@ func (r *Runner) preRunE(_ *cobra.Command, args []string) error { return r.Validate() } -func (r *Runner) runE(c *cobra.Command, args []string) error { +func (r *Runner) runE(_ *cobra.Command, _ []string) error { return r.Run(r.ctx) } diff --git a/commands/pkg/get/cmdget.go b/commands/pkg/get/cmdget.go index de9dedd95c..880df94451 100644 --- a/commands/pkg/get/cmdget.go +++ b/commands/pkg/get/cmdget.go @@ -114,7 +114,7 @@ func (r *Runner) preRunE(_ *cobra.Command, args []string) error { return nil } -func (r *Runner) runE(c *cobra.Command, _ []string) error { +func (r *Runner) runE(_ *cobra.Command, _ []string) error { const op errors.Op = "cmdget.runE" if err := r.Get.Run(r.ctx); err != nil { return errors.E(op, types.UniquePath(r.Get.Destination), err) diff --git a/commands/pkg/get/cmdget_test.go b/commands/pkg/get/cmdget_test.go index 1a737f240b..0ea48b3935 100644 --- a/commands/pkg/get/cmdget_test.go +++ b/commands/pkg/get/cmdget_test.go @@ -177,7 +177,7 @@ type NoOpFailRunE struct { t *testing.T } -func (t NoOpFailRunE) runE(cmd *cobra.Command, args []string) error { +func (t NoOpFailRunE) runE(_ *cobra.Command, _ []string) error { assert.Fail(t.t, "run should not be called") return nil } diff --git a/commands/pkg/init/cmdinit.go b/commands/pkg/init/cmdinit.go index 5f12c8a9b9..158e442997 100644 --- a/commands/pkg/init/cmdinit.go +++ b/commands/pkg/init/cmdinit.go @@ -62,7 +62,7 @@ type Runner struct { Ctx context.Context } -func (r *Runner) runE(c *cobra.Command, args []string) error { +func (r *Runner) runE(_ *cobra.Command, args []string) error { if len(args) == 0 { args = append(args, pkg.CurDir) } diff --git a/commands/pkg/update/cmdupdate.go b/commands/pkg/update/cmdupdate.go index 960b2a162b..855ad72eef 100644 --- a/commands/pkg/update/cmdupdate.go +++ b/commands/pkg/update/cmdupdate.go @@ -122,7 +122,7 @@ func (r *Runner) preRunE(_ *cobra.Command, args []string) error { return nil } -func (r *Runner) runE(c *cobra.Command, _ []string) error { +func (r *Runner) runE(_ *cobra.Command, _ []string) error { const op errors.Op = "cmdupdate.runE" if err := r.Update.Run(r.ctx); err != nil { return errors.E(op, r.Update.Pkg.UniquePath, err) diff --git a/commands/pkg/update/cmdupdate_test.go b/commands/pkg/update/cmdupdate_test.go index 367a4e31a9..a788e4ca8e 100644 --- a/commands/pkg/update/cmdupdate_test.go +++ b/commands/pkg/update/cmdupdate_test.go @@ -286,7 +286,7 @@ type NoOpFailRunE struct { t *testing.T } -func (t NoOpFailRunE) runE(cmd *cobra.Command, args []string) error { +func (t NoOpFailRunE) runE(_ *cobra.Command, _ []string) error { assert.Fail(t.t, "run should not be called") return nil } diff --git a/dogfood/sitev2/go.mod b/dogfood/sitev2/go.mod index 4ea6372798..d48c9a7277 100644 --- a/dogfood/sitev2/go.mod +++ b/dogfood/sitev2/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleContainerTools/kpt/dogfood/sitev2 -go 1.19 +go 1.20 require ( github.com/yuin/goldmark v1.4.12 diff --git a/go.mod b/go.mod index 2bc51d140d..e921eab0b4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleContainerTools/kpt -go 1.19 +go 1.20 require ( github.com/GoogleContainerTools/kpt/porch/api v0.0.0-20230121152246-dc44dbd18a33 @@ -30,7 +30,7 @@ require ( k8s.io/cli-runtime v0.25.3 k8s.io/client-go v0.25.3 k8s.io/component-base v0.25.3 - k8s.io/klog/v2 v2.90.0 + k8s.io/klog/v2 v2.90.1 k8s.io/kubectl v0.25.3 sigs.k8s.io/cli-utils v0.34.0 sigs.k8s.io/controller-runtime v0.13.1 @@ -65,9 +65,9 @@ require ( github.com/fatih/camelcase v1.0.0 // indirect github.com/fvbommel/sortorder v1.0.1 // indirect github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.2.0 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -82,7 +82,6 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.16.0 // indirect - github.com/kr/pretty v0.2.1 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect @@ -120,7 +119,7 @@ require ( google.golang.org/protobuf v1.29.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect + k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 // indirect k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect diff --git a/go.sum b/go.sum index 1759a750f7..a7f14f662c 100644 --- a/go.sum +++ b/go.sum @@ -99,14 +99,12 @@ github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= @@ -187,9 +185,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= @@ -214,7 +209,6 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.2.0 h1:3ZNA3L1c5FYDFTTxbFeVGGD8jYvjYauHD30YgLxVsNI= @@ -279,7 +273,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -418,10 +411,9 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -454,10 +446,10 @@ k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= k8s.io/component-base v0.25.3 h1:UrsxciGdrCY03ULT1h/S/gXFCOPnLhUVwSyx+hM/zq4= k8s.io/component-base v0.25.3/go.mod h1:WYoS8L+IlTZgU7rhAl5Ctpw0WdMxDfCC5dkxcEFa/TI= -k8s.io/klog/v2 v2.90.0 h1:VkTxIV/FjRXn1fgNNcKGM8cfmL1Z33ZjXRTVxKCoF5M= -k8s.io/klog/v2 v2.90.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 h1:8cNCQs+WqqnSpZ7y0LMQPKD+RZUHU17VqLPMW3qxnxc= +k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0= k8s.io/kubectl v0.25.3 h1:HnWJziEtmsm4JaJiKT33kG0kadx68MXxUE8UEbXnN4U= k8s.io/kubectl v0.25.3/go.mod h1:glU7PiVj/R6Ud4A9FJdTcJjyzOtCJyc0eO7Mrbh3jlI= k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8= diff --git a/healthcheck/go.mod b/healthcheck/go.mod index 2285b414aa..f54a0c0e8f 100644 --- a/healthcheck/go.mod +++ b/healthcheck/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleContainerTools/kpt/healthcheck -go 1.19 +go 1.20 require ( k8s.io/apimachinery v0.26.1 diff --git a/internal/alpha/printers/table/collector.go b/internal/alpha/printers/table/collector.go index 9d03319b98..b36915fd13 100644 --- a/internal/alpha/printers/table/collector.go +++ b/internal/alpha/printers/table/collector.go @@ -21,7 +21,7 @@ import ( const InvalidStatus status.Status = "Invalid" -func newResourceStateCollector(resourceGroups []event.ActionGroup, out io.Writer) *resourceStateCollector { +func newResourceStateCollector(resourceGroups []event.ActionGroup, _ io.Writer) *resourceStateCollector { resourceInfos := make(map[object.ObjMetadata]*resourceInfo) for _, group := range resourceGroups { action := group.Action diff --git a/internal/fnruntime/container.go b/internal/fnruntime/container.go index 42bb8e77a5..3c9b4cef98 100644 --- a/internal/fnruntime/container.go +++ b/internal/fnruntime/container.go @@ -226,7 +226,7 @@ func NewContainerEnvFromStringSlice(envStr []string) *runtimeutil.ContainerEnv { // ResolveToImageForCLI converts the function short path to the full image url. // If the function is Catalog function, it adds "gcr.io/kpt-fn/".e.g. set-namespace:v0.1 --> gcr.io/kpt-fn/set-namespace:v0.1 -func ResolveToImageForCLI(ctx context.Context, image string) (string, error) { +func ResolveToImageForCLI(_ context.Context, image string) (string, error) { if !strings.Contains(image, "/") { return fmt.Sprintf("gcr.io/kpt-fn/%s", image), nil } diff --git a/internal/util/get/example_test.go b/internal/util/get/example_test.go index 2eac4803b5..f55c9b59a4 100644 --- a/internal/util/get/example_test.go +++ b/internal/util/get/example_test.go @@ -15,6 +15,7 @@ package get_test import ( + "fmt" "path/filepath" "github.com/GoogleContainerTools/kpt/internal/util/get" @@ -28,7 +29,7 @@ func ExampleCommand() { Ref: "v1.0", }}.Run(fake.CtxWithDefaultPrinter()) if err != nil { - // handle error + fmt.Print(err.Error()) } } @@ -38,7 +39,7 @@ func ExampleCommand_branch() { Ref: "refs/heads/v1.0", }}.Run(fake.CtxWithDefaultPrinter()) if err != nil { - // handle error + fmt.Print(err.Error()) } } @@ -48,7 +49,7 @@ func ExampleCommand_tag() { Ref: "refs/tags/v1.0", }}.Run(fake.CtxWithDefaultPrinter()) if err != nil { - // handle error + fmt.Print(err.Error()) } } @@ -58,7 +59,7 @@ func ExampleCommand_commit() { Ref: "8186bef8e5c0621bf80fa8106bd595aae8b62884", }}.Run(fake.CtxWithDefaultPrinter()) if err != nil { - // handle error + fmt.Print(err.Error()) } } @@ -71,7 +72,7 @@ func ExampleCommand_subdir() { }, }.Run(fake.CtxWithDefaultPrinter()) if err != nil { - // handle error + fmt.Print(err.Error()) } } @@ -83,6 +84,6 @@ func ExampleCommand_destination() { }, Destination: "destination-dir"}.Run(fake.CtxWithDefaultPrinter()) if err != nil { - // handle error + fmt.Print(err.Error()) } } diff --git a/internal/util/porch/approval.go b/internal/util/porch/approval.go index 75db88245f..57bae25ac7 100644 --- a/internal/util/porch/approval.go +++ b/internal/util/porch/approval.go @@ -58,7 +58,7 @@ func UpdatePackageRevisionApproval(ctx context.Context, client rest.Interface, k opts := metav1.UpdateOptions{} result := &v1alpha1.PackageRevision{} - if err := client.Put(). + return client.Put(). Namespace(pr.Namespace). Resource("packagerevisions"). Name(pr.Name). @@ -66,8 +66,5 @@ func UpdatePackageRevisionApproval(ctx context.Context, client rest.Interface, k VersionedParams(&opts, codec). Body(&pr). Do(ctx). - Into(result); err != nil { - return err - } - return nil + Into(result) } diff --git a/pkg/fn/multiruntime.go b/pkg/fn/multiruntime.go index 6c0a9c8943..5833b68e76 100644 --- a/pkg/fn/multiruntime.go +++ b/pkg/fn/multiruntime.go @@ -41,9 +41,7 @@ func (r *MultiRuntime) GetRunner(ctx context.Context, fn *v1.Function) (Function runner, err := runtime.GetRunner(ctx, fn) if err != nil { var notFoundError *NotFoundError - if errors.As(err, ¬FoundError) { - // maybe another runtime - } else { + if !errors.As(err, ¬FoundError) { return nil, err } } else { diff --git a/pkg/oci/cache.go b/pkg/oci/cache.go index f5b8fec814..0b96d842cf 100644 --- a/pkg/oci/cache.go +++ b/pkg/oci/cache.go @@ -63,7 +63,7 @@ func (r *Storage) CachedConfigFile(ctx context.Context, imageName imageName) (*v // CachedManifest fetches Manifest making use of the cache // TODO: This should be incorporated into the go-containerregistry, along with replacing a fetcher -func (r *Storage) CachedManifest(ctx context.Context, image v1.Image) (*v1.Manifest, error) { +func (r *Storage) CachedManifest(_ context.Context, image v1.Image) (*v1.Manifest, error) { digest, err := image.Digest() if err != nil { return nil, fmt.Errorf("cannot get image manifest: %w", err) diff --git a/porch/api/go.mod b/porch/api/go.mod index fcfcdee448..4d2042ff06 100644 --- a/porch/api/go.mod +++ b/porch/api/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleContainerTools/kpt/porch/api -go 1.19 +go 1.20 require ( golang.org/x/tools v0.1.12 diff --git a/porch/build/Dockerfile.apiserver b/porch/build/Dockerfile.apiserver index a43b3d2ecf..704ec06502 100644 --- a/porch/build/Dockerfile.apiserver +++ b/porch/build/Dockerfile.apiserver @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.19-bullseye as builder +FROM golang:1.20-bullseye as builder WORKDIR /workspace/src RUN git clone https://github.com/kubernetes/kubernetes --branch v1.23.2 --depth=1 diff --git a/porch/build/Dockerfile.etcd b/porch/build/Dockerfile.etcd index 14df28ee94..12185fad8e 100644 --- a/porch/build/Dockerfile.etcd +++ b/porch/build/Dockerfile.etcd @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.19-bullseye as builder +FROM golang:1.20-bullseye as builder WORKDIR /workspace ARG ETCD_VER=v3.5.1 diff --git a/porch/build/Dockerfile.porch b/porch/build/Dockerfile.porch index a03564bced..c05dce9455 100644 --- a/porch/build/Dockerfile.porch +++ b/porch/build/Dockerfile.porch @@ -13,7 +13,7 @@ # limitations under the License. -FROM golang:1.19-bullseye as builder +FROM golang:1.20-bullseye as builder WORKDIR /go/src/github.com/GoogleContainerTools/kpt diff --git a/porch/controllers/Dockerfile b/porch/controllers/Dockerfile index 1734fb0123..64e3636d84 100644 --- a/porch/controllers/Dockerfile +++ b/porch/controllers/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.19-bullseye as builder +FROM golang:1.20-bullseye as builder WORKDIR /workspace COPY go.mod go.sum ./ diff --git a/porch/docs/running-locally.md b/porch/docs/running-locally.md index dc98957197..b813b720e0 100644 --- a/porch/docs/running-locally.md +++ b/porch/docs/running-locally.md @@ -7,7 +7,7 @@ To run Porch locally, you will need: * Linux machine (technically it is possible to run Porch locally on a Mac but due to differences in Docker between Linux and Mac, the Porch scripts are confirmed to work on Linux) -* [go 1.19](https://go.dev/dl/) or newer +* [go 1.20](https://go.dev/dl/) or newer * [docker](https://docs.docker.com/get-docker/) * [git](https://git-scm.com/) * `make` diff --git a/porch/examples/apps/hello-server/Dockerfile b/porch/examples/apps/hello-server/Dockerfile index 49538a8ba4..644b255d30 100644 --- a/porch/examples/apps/hello-server/Dockerfile +++ b/porch/examples/apps/hello-server/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.19-bullseye as builder +FROM golang:1.20-bullseye as builder WORKDIR /src COPY go.mod go.sum ./ diff --git a/porch/examples/apps/hello-server/go.mod b/porch/examples/apps/hello-server/go.mod index f08dc7f34f..87a77e4793 100644 --- a/porch/examples/apps/hello-server/go.mod +++ b/porch/examples/apps/hello-server/go.mod @@ -1,3 +1,3 @@ module github.com/GoogleContainerTools/kpt/porch/config/samples/apps/hello -go 1.19 +go 1.20 diff --git a/porch/func/Dockerfile b/porch/func/Dockerfile index e410214593..f4efe3bab6 100644 --- a/porch/func/Dockerfile +++ b/porch/func/Dockerfile @@ -25,7 +25,7 @@ FROM gcr.io/kpt-fn/set-project-id:v0.2.0 as set-project-id FROM gcr.io/kpt-fn/starlark:v0.3.0 as starlark FROM gcr.io/kpt-fn/upsert-resource:v0.2.0 as upsert-resource -FROM golang:1.19.5-alpine3.17 as builder +FROM golang:1.20.3-alpine3.17 as builder WORKDIR /go/src/github.com/GoogleContainerTools/kpt RUN go install github.com/grpc-ecosystem/grpc-health-probe@v0.4.11 diff --git a/porch/func/Dockerfile-wrapperserver b/porch/func/Dockerfile-wrapperserver index 6f89052104..083d65eafb 100644 --- a/porch/func/Dockerfile-wrapperserver +++ b/porch/func/Dockerfile-wrapperserver @@ -1,4 +1,4 @@ -FROM golang:1.19.5-alpine3.17 as builder +FROM golang:1.20.3-alpine3.17 as builder WORKDIR /go/src/github.com/GoogleContainerTools/kpt diff --git a/porch/go.mod b/porch/go.mod index 6c33d313e5..e618b948b1 100644 --- a/porch/go.mod +++ b/porch/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleContainerTools/kpt/porch -go 1.19 +go 1.20 replace ( github.com/GoogleContainerTools/kpt => ../ @@ -50,7 +50,7 @@ require ( k8s.io/apiserver v0.25.3 k8s.io/client-go v0.25.3 k8s.io/component-base v0.25.3 - k8s.io/klog/v2 v2.90.0 + k8s.io/klog/v2 v2.90.1 k8s.io/kube-aggregator v0.24.0-beta.0 k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 sigs.k8s.io/cli-utils v0.34.0 @@ -103,9 +103,9 @@ require ( github.com/go-errors/errors v1.4.2 // indirect github.com/go-git/gcfg v1.5.0 // indirect github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -186,7 +186,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.25.3 // indirect k8s.io/cli-runtime v0.25.3 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect + k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 // indirect k8s.io/kubectl v0.25.3 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33 // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect diff --git a/porch/go.sum b/porch/go.sum index 550fea4ce3..8148718b41 100644 --- a/porch/go.sum +++ b/porch/go.sum @@ -259,16 +259,17 @@ github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -1232,14 +1233,14 @@ k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAE k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.90.0 h1:VkTxIV/FjRXn1fgNNcKGM8cfmL1Z33ZjXRTVxKCoF5M= -k8s.io/klog/v2 v2.90.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-aggregator v0.24.0-beta.0 h1:pRl/qwCw2XBuWrMzkTiWOFfONZtClgHWdbKmIZdDY8o= k8s.io/kube-aggregator v0.24.0-beta.0/go.mod h1:i9SRRGwxhXwuNuArHlkfy/EuWSrrbUEsIah/7OROTZU= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= +k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 h1:8cNCQs+WqqnSpZ7y0LMQPKD+RZUHU17VqLPMW3qxnxc= +k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0= k8s.io/kubectl v0.25.3 h1:HnWJziEtmsm4JaJiKT33kG0kadx68MXxUE8UEbXnN4U= k8s.io/kubectl v0.25.3/go.mod h1:glU7PiVj/R6Ud4A9FJdTcJjyzOtCJyc0eO7Mrbh3jlI= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/porch/test/Dockerfile b/porch/test/Dockerfile index 872249cec4..e1536b8a5d 100644 --- a/porch/test/Dockerfile +++ b/porch/test/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. -FROM golang:1.19-bullseye as builder +FROM golang:1.20-bullseye as builder WORKDIR /go/src/github.com/GoogleContainerTools/kpt diff --git a/release/formula/main.go b/release/formula/main.go index 591fb44086..52bba0439c 100644 --- a/release/formula/main.go +++ b/release/formula/main.go @@ -35,7 +35,7 @@ func main() { } } -func run(ctx context.Context) error { +func run(_ context.Context) error { if len(os.Args) < 2 { return fmt.Errorf("must specify new version") } diff --git a/rollouts/Dockerfile b/rollouts/Dockerfile index 907f16316d..29ddad85ea 100644 --- a/rollouts/Dockerfile +++ b/rollouts/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Build the manager binary -FROM golang:1.19 as builder +FROM golang:1.20 as builder ARG TARGETOS ARG TARGETARCH diff --git a/rollouts/docs/running-locally.md b/rollouts/docs/running-locally.md index 0c5794540c..65b3491f81 100644 --- a/rollouts/docs/running-locally.md +++ b/rollouts/docs/running-locally.md @@ -7,7 +7,7 @@ To run Rollouts locally, you will need: * Linux machine (technically it is possible to run Rollouts locally on a Mac but due to differences in Docker between Linux and Mac, the Rollouts scripts are confirmed to work on Linux) -* [go 1.19](https://go.dev/dl/) or newer +* [go 1.20](https://go.dev/dl/) or newer * `make` * Either access to GKE clusters, or Kind. diff --git a/rollouts/go.mod b/rollouts/go.mod index 64f154b108..5780d1da0c 100644 --- a/rollouts/go.mod +++ b/rollouts/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleContainerTools/kpt/rollouts -go 1.19 +go 1.20 require ( cloud.google.com/go/iam v0.7.0 diff --git a/tools/licensescan/go.mod b/tools/licensescan/go.mod index f9bf261755..c6d1ac0dbc 100644 --- a/tools/licensescan/go.mod +++ b/tools/licensescan/go.mod @@ -1,6 +1,6 @@ module github.com/GoogleContainerTools/kpt/tools/licensescan -go 1.19 +go 1.20 require ( github.com/spf13/cobra v1.5.0