Skip to content

Commit 929d1c0

Browse files
committed
type: upgrade go version to 1.25.7 to address security vulns
Signed-off-by: Minna Howell <minnah@google.com>
1 parent cdbbd91 commit 929d1c0

File tree

34 files changed

+128
-110
lines changed

34 files changed

+128
-110
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
GOLANG_VERSION := 1.26.0
15+
GOLANG_VERSION := 1.25.7
1616
GORELEASER_CONFIG = release/tag/goreleaser.yaml
1717
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GOLANG_VERSION)
1818

commands/alpha/live/plan/diff.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323

2424
type Diff struct {
2525
Type string
26-
Left any
27-
Right any
26+
Left interface{}
27+
Right interface{}
2828
Path string
2929
}
3030

@@ -36,7 +36,7 @@ func diffObjects(b, a *unstructured.Unstructured) ([]Diff, error) {
3636
return diffs, nil
3737
}
3838

39-
func diffMaps(prefix string, l, r map[string]any) ([]Diff, error) {
39+
func diffMaps(prefix string, l, r map[string]interface{}) ([]Diff, error) {
4040
var diffs []Diff
4141
for k, lv := range l {
4242
childPrefix := prefix + "." + k
@@ -66,7 +66,7 @@ func diffMaps(prefix string, l, r map[string]any) ([]Diff, error) {
6666
return diffs, nil
6767
}
6868

69-
func diffSlices(prefix string, l, r []any) ([]Diff, error) {
69+
func diffSlices(prefix string, l, r []interface{}) ([]Diff, error) {
7070
var diffs []Diff
7171
for i, lv := range l {
7272
childPrefix := prefix + "." + strconv.Itoa(i)
@@ -95,7 +95,7 @@ func diffSlices(prefix string, l, r []any) ([]Diff, error) {
9595
return diffs, nil
9696
}
9797

98-
func diffValue(path string, lv, rv any) ([]Diff, error) {
98+
func diffValue(path string, lv, rv interface{}) ([]Diff, error) {
9999
switch lv := lv.(type) {
100100
// case string:
101101
// rvString, ok := rv.(string)
@@ -107,15 +107,15 @@ func diffValue(path string, lv, rv any) ([]Diff, error) {
107107
// if !ok || lv != rvInt64 {
108108
// diffs = append(diffs, Diff{Type: "Change", Path: childPrefix, Left: lv, Right: rv})
109109
// }
110-
case map[string]any:
111-
rvMap, ok := rv.(map[string]any)
110+
case map[string]interface{}:
111+
rvMap, ok := rv.(map[string]interface{})
112112
if !ok {
113113
return []Diff{{Type: "Change", Path: path, Left: lv, Right: rv}}, nil
114114
}
115115
return diffMaps(path, lv, rvMap)
116116

117-
case []any:
118-
rvSlice, ok := rv.([]any)
117+
case []interface{}:
118+
rvSlice, ok := rv.([]interface{})
119119
if !ok {
120120
return []Diff{{Type: "Change", Path: path, Left: lv, Right: rv}}, nil
121121
}

commands/alpha/rollouts/get/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func renderRolloutsAsTable(cmd *cobra.Command, rollouts *rolloutsapi.RolloutList
8282
readyCount++
8383
}
8484
}
85-
t.AppendRow([]any{
85+
t.AppendRow([]interface{}{
8686
rollout.Name,
8787
rollout.Status.Overall,
8888
fmt.Sprintf("%d/%d", readyCount, len(rollout.Status.ClusterStatuses))})

commands/alpha/rollouts/status/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func renderStatusAsTable(cmd *cobra.Command, rollout *rolloutsapi.Rollout) {
8989
t.AppendHeader(table.Row{"CLUSTER", "PACKAGE ID", "PACKAGE STATUS", "SYNC STATUS"})
9090
for _, cluster := range rollout.Status.ClusterStatuses {
9191
pkgStatus := cluster.PackageStatus
92-
t.AppendRow([]any{cluster.Name, pkgStatus.PackageID, pkgStatus.Status, pkgStatus.SyncStatus})
92+
t.AppendRow([]interface{}{cluster.Name, pkgStatus.PackageID, pkgStatus.Status, pkgStatus.SyncStatus})
9393
}
9494
t.AppendSeparator()
9595
// t.AppendRow([]interface{}{300, "Tyrion", "Lannister", 5000})
@@ -108,7 +108,7 @@ func renderWaveStatusAsTable(cmd *cobra.Command, rollout *rolloutsapi.Rollout) {
108108
if i == 0 {
109109
waveName = wave.Name
110110
}
111-
t.AppendRow([]any{waveName, cluster.Name, pkgStatus.PackageID, pkgStatus.Status, pkgStatus.SyncStatus})
111+
t.AppendRow([]interface{}{waveName, cluster.Name, pkgStatus.PackageID, pkgStatus.Status, pkgStatus.SyncStatus})
112112
}
113113
t.AppendSeparator()
114114
}

commands/live/migrate/migratecmd_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ var inventoryObjName = "test-inventory-obj"
4141
var testInventoryLabel = "test-inventory-label"
4242

4343
var rgInvObj = &unstructured.Unstructured{
44-
Object: map[string]any{
44+
Object: map[string]interface{}{
4545
"apiVersion": "kpt.dev/v1alpha1",
4646
"kind": "ResourceGroup",
47-
"metadata": map[string]any{
47+
"metadata": map[string]interface{}{
4848
"name": inventoryObjName,
4949
"namespace": testNamespace,
50-
"labels": map[string]any{
50+
"labels": map[string]interface{}{
5151
common.InventoryLabel: testInventoryLabel,
5252
},
5353
},
54-
"spec": map[string]any{
55-
"resources": []any{},
54+
"spec": map[string]interface{}{
55+
"resources": []interface{}{},
5656
},
5757
},
5858
}
@@ -68,35 +68,35 @@ metadata:
6868
`
6969

7070
var cmInvObj = &unstructured.Unstructured{
71-
Object: map[string]any{
71+
Object: map[string]interface{}{
7272
"apiVersion": "v1",
7373
"kind": "ConfigMap",
74-
"metadata": map[string]any{
74+
"metadata": map[string]interface{}{
7575
"name": inventoryObjName,
7676
"namespace": testNamespace,
77-
"labels": map[string]any{
77+
"labels": map[string]interface{}{
7878
common.InventoryLabel: testInventoryLabel,
7979
},
8080
},
8181
},
8282
}
8383

8484
var pod1 = &unstructured.Unstructured{
85-
Object: map[string]any{
85+
Object: map[string]interface{}{
8686
"apiVersion": "v1",
8787
"kind": "Pod",
88-
"metadata": map[string]any{
88+
"metadata": map[string]interface{}{
8989
"name": "pod-1",
9090
"namespace": testNamespace,
9191
},
9292
},
9393
}
9494

9595
var pod2 = &unstructured.Unstructured{
96-
Object: map[string]any{
96+
Object: map[string]interface{}{
9797
"apiVersion": "v1",
9898
"kind": "Pod",
99-
"metadata": map[string]any{
99+
"metadata": map[string]interface{}{
100100
"name": "pod-2",
101101
"namespace": testNamespace,
102102
},

commands/pkg/update/cmdupdate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ Updated 2 package(s).
787787

788788
tmpl := template.Must(template.New("test").Parse(tc.expectedOutput))
789789
var expected bytes.Buffer
790-
err = tmpl.Execute(&expected, map[string]any{
790+
err = tmpl.Execute(&expected, map[string]interface{}{
791791
"PKG_PATH": g.LocalWorkspace.FullPackagePath(),
792792
"PKG_NAME": g.LocalWorkspace.PackageDir,
793793
"REPOS": g.Repos,

documentation/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/kptdev/docs
22

3-
go 1.26.0
3+
go 1.25.7
44

55
require github.com/google/docsy v0.12.0 // indirect

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kptdev/kpt
22

3-
go 1.26.0
3+
go 1.25.7
44

55
require (
66
github.com/bytecodealliance/wasmtime-go v1.0.0

healthcheck/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kptdev/kpt/healthcheck
22

3-
go 1.26.0
3+
go 1.25.7
44

55
require (
66
k8s.io/apimachinery v0.34.1

internal/alpha/printers/table/printer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func getConditions(rs *pollingevent.ResourceStatus) []string {
264264

265265
var conditionStrings []string
266266
for _, cond := range conditions {
267-
condition := cond.(map[string]any)
267+
condition := cond.(map[string]interface{})
268268
conditionType := condition["type"].(string)
269269
conditionStatus := condition["status"].(string)
270270
conditionReason := condition["reason"].(string)

0 commit comments

Comments
 (0)