Commit Graph

73 Commits (6d92b2208fa14f69226ee89cebda3d203e683e25)

Author SHA1 Message Date
Medya Ghazizadeh 6d92b2208f
separate go mod for hack folder (#21060)
* separate go mod for hack folder and use go work

* remove dependecy on k8s.minikube inside hack

* remove gowork files
2025-07-13 14:37:20 -07:00
Tian 3cf1e63e21
build: address all lint issues by v2 (#20804)
* fix QF1011: could omit type *os.File from declaration; it will be inferred from the right-hand side

* fix QF1012: Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))

* fix QF1001: could apply De Morgan's law

* fix QF1003: could use tagged switch

* fix weakCond: suspicious ; nil check may not be enough, check for len (gocritic)

* fix docStub: silencing go lint doc-comment warnings is unadvised

* fix builtinShadow: shadowing of predeclared identifier: error

* fix importShadow: shadow of imported package

* fix nestingReduce: invert if cond, replace body with , move old body after the statement

* useless-break: useless break in case clause (revive)

* Clear the redundant content in golangci.yaml file
2025-05-23 17:31:28 -07:00
Victor Ubahakwe 4ebec48d8b
Prevent Unnecessary Version Bumps in `go.mod` During Go Version Updates (#20781)
* Prevent Unnecessary Version Bumps in `go.mod` During Go Version Updates

This PR addresses issue #20770, where the minikube automation (triggered by make `update-golang-version`) unnecessarily bumped minor or patch versions in `go.mod` when updating the Go version. Following Kubernetes' practice, which avoids such bumps in `go.mod`, this change ensures only the go directive is updated to the stable Go version.

**Changes:**
- Added `go.mod` to the schema map in `hack/update/golang_version/update_golang_version.go` with a regex (go 1\.\d+\.\d+) to update the go directive to {{.StableVersion}} (e.g., go 1.24.2).
- This ensures the automation updates only the go directive without modifying module dependencies, aligning with Kubernetes' `go.mod` behavior.

**Impact:**
- Running make `update-golang-version` now updates the go directive (e.g., from go 1.22.3 to go 1.24.2) without unintended dependency version bumps.
- Tested by setting go 1.22.3 in go.mod, running go mod tidy and make update-golang-version, and verifying only the go directive and toolchain changed.

fixes: #20773

* Pin `go.mod` to Major.Minor Go Version (e.g., `1.24.0`)

**Description**:
Fixes #20773 by updating the automation to pin the `go` directive in `go.mod` to the major.minor Go version (e.g., `1.24.0`) instead of the full version (e.g., `1.24.2`), aligning with Kubernetes’ `go.mod`. This prevents breaking users relying on minikube packages.

**Changes**:
- Modified `hack/update/golang_version/update_golang_version.go` to compute `MajorMinor` version (e.g., `1.24.0`) from `StableVersion`.
- Updated `schema` to set `go.mod`’s `go` directive to `{{.MajorMinor}}`.
- Tested by setting `go 1.23.4`, running `make update-golang-version`, and verifying `go 1.24.0` with no dependency bumps.

**Closes**: #20773

* Reverted all 66 files to upstream master except update_golang_version.go
2025-05-20 11:03:15 -07:00
Steven Powell c1b68a90e7 remove stableMM from goVersions return 2024-05-07 08:52:36 -07:00
Steven Powell 904d97fd1a remove orphaned usage of stableMM 2024-05-07 08:52:36 -07:00
Steven Powell c8f6f1e449 remove StableVersionMM 2024-05-07 08:52:36 -07:00
Steven Powell 7f64b6e6dc CI: Fix Go auto update 2024-05-07 08:52:36 -07:00
Steven Powell 4bd203f0c7 CI: Stop auto updating ISO Go version 2024-04-18 10:12:44 -07:00
Steven Powell 9277aac12d Addon gvisor: Add building arm64 image 2024-03-19 11:41:51 -07:00
Timothée Ravier 57154d3e3e hack/update: Re-enable Go updates 2024-02-22 20:00:53 +01:00
Steven Powell b4fd5bf415 CI: Build auto-pause-hook for all architectures 2023-12-28 14:57:02 -07:00
Steven Powell aa99141911 CI: Automate updating workflow files 2023-06-12 13:09:50 -07:00
Steven Powell 72c627d257
Merge branch 'master' into automateCalico 2023-06-06 14:01:47 -07:00
Steven Powell 0c87d443b9
Merge branch 'master' into automateUpdatingInspektor 2023-06-06 13:59:53 -07:00
Steven Powell b83e3f7a1a CI: Automate updating calico 2023-06-06 13:52:41 -07:00
Steven Powell b2f6351ec7 CI: Automate updating flannel 2023-06-06 13:45:57 -07:00
Steven Powell 984dc6d4bb CI: Automate updating inspektor-gadget addon 2023-06-06 09:10:01 -07:00
Steven Powell 20efd5a30f remove golang update duplication 2023-06-05 16:46:05 -07:00
Steven Powell edd4e36121 CI: Automate updating ingress images 2023-06-05 13:21:33 -07:00
Steven Powell 2bdb8ec8f4 add new workflow file to go update 2023-06-05 09:21:51 -07:00
Steven Powell 281616e9ac CI: Automate updating gcp-auth-webhook image 2023-05-26 10:06:25 -07:00
Steven Powell ac7d0788f4 CI: Automate updating cni-plugins 2023-05-08 09:38:02 -07:00
salasberryfin f71b903f40 add GitHub Action to check for ubuntu:focal updates periodically 2023-05-03 17:21:54 +02:00
Steven Powell 9137397338 CI: Automate updating docker version 2023-04-06 15:17:03 -07:00
Steven Powell 13afd5f0d8 CI: cron to auto update runc 2023-03-29 11:26:00 -07:00
Steven Powell 479a97f62a CI: Auto update metrics-server addon 2023-03-22 11:29:41 -07:00
Steven Powell c1a4ff3c50 move GoVersion variable 2023-03-02 09:57:00 -08:00
Steven Powell 5f072f0514 auto update cri-o version 2023-02-27 10:01:28 -08:00
Steven Powell c0a79c3ca2 create automation to update buildkit version 2023-02-27 09:31:59 -08:00
Steven Powell a05fd98943 auto update containerd 2023-02-24 14:03:04 -08:00
Steven Powell 000d06a38a rollback ISO Go version and prevent automation from updating it 2023-02-22 09:36:52 -08:00
Steven Powell b69ce7e757 CI: auto update cloud-spanner-emulator 2023-02-17 12:33:02 -08:00
Steven Powell cf9cfe19be skip updating golang hash file if version already exists 2023-01-30 09:10:43 -08:00
Steven Powell 04fa4dc3f5 add newline to end of hash file 2023-01-24 14:14:28 -08:00
Steven Powell 45c7854e5f improve automated golang version updating 2023-01-24 14:12:18 -08:00
Steven Powell 9059a88efb update golang version 2022-12-02 09:38:46 -08:00
Steven Powell 0f2edf59f2 auto update Docsy 2022-12-01 11:54:33 -08:00
Steven Powell e83741569a add workflow to update gh version 2022-11-22 09:52:40 -08:00
Steven Powell 5e58b47934 remove deprecated set-output 2022-10-27 14:41:39 -07:00
Steven Powell 98377c37b0 automate updating yearly leaderboard 2022-06-21 15:44:26 -07:00
Steven Powell aa1d305412 add script to update cri-docker 2022-06-13 10:41:24 -07:00
Steven Powell 022e7bfc9a automate updating kubectl version 2022-06-07 16:27:41 -07:00
Steven Powell 4f5a12838f automate updating Window Go version 2022-05-25 14:39:18 -07:00
Steven Powell 95ad2fe67e
Merge branch 'master' into updateGotestsum 2022-05-24 13:20:28 -07:00
Steven Powell 910fe36c07 update go version 2022-05-24 13:06:38 -07:00
Steven Powell 1dde1d5956 automate updating gopogh 2022-05-24 12:31:26 -07:00
Steven Powell 595a340b7a skip updating to rc version of Golang 2022-03-01 12:02:12 -08:00
Medya Gh 7c36934049 add job to auto-update kubeadm constants for images 2021-12-06 17:44:25 -08:00
Steven Powell b6e8a3be1b directly code golang version 2021-10-20 16:29:58 -07:00
KallyDev 70022d9b2e
Move from deprecated ioutil to os and io packages 2021-10-08 08:57:19 +08:00