Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"]

env:
GO_VERSION: '1.22.12'
GO_VERSION: '1.23.0'

jobs:
detect-noop:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

env:
# Common versions
GO_VERSION: '1.22.12'
GO_VERSION: '1.23.0'

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
MEMBER_AGENT_IMAGE_NAME: member-agent
REFRESH_TOKEN_IMAGE_NAME: refresh-token

GO_VERSION: '1.22.12'
GO_VERSION: '1.23.0'

jobs:
export-registry:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"]

env:
GO_VERSION: '1.22.12'
GO_VERSION: '1.23.0'

jobs:
detect-noop:
Expand Down
15 changes: 13 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
run:
deadline: 10m
go: '1.22.12'
timeout: 15m
go: '1.23.0'

linters-settings:
stylecheck:
checks: [ "all", "-ST1001" ] # Disables dot-import warnings
revive:
rules:
- name: dot-imports
disabled: true
gosec:
excludes:
- G404 #Use of weak random number generator (math/rand or math/rand/v2). It is only used in tests.

linters:
disable-all: true
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ CONTROLLER_GEN_VER := v0.16.0
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))

STATICCHECK_VER := 2023.1.7
STATICCHECK_VER := 2024.1
Comment thread
britaniar marked this conversation as resolved.
STATICCHECK_BIN := staticcheck
STATICCHECK := $(abspath $(TOOLS_BIN_DIR)/$(STATICCHECK_BIN)-$(STATICCHECK_VER))

GOIMPORTS_VER := latest
GOIMPORTS_BIN := goimports
GOIMPORTS := $(abspath $(TOOLS_BIN_DIR)/$(GOIMPORTS_BIN)-$(GOIMPORTS_VER))

GOLANGCI_LINT_VER := v1.52.2
GOLANGCI_LINT_VER := v1.64.7
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER))

Expand Down
2 changes: 1 addition & 1 deletion docker/hub-agent.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the hubagent binary
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22.12 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.0 AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion docker/member-agent.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the memberagent binary
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22.12 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.0 AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion docker/refresh-token.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the hubagent binary
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22.12 AS builder
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.0 AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.goms.io/fleet

go 1.22.12
go 1.23.0

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0
Expand All @@ -23,7 +23,7 @@ require (
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6
golang.org/x/sync v0.10.0
golang.org/x/sync v0.11.0
golang.org/x/time v0.7.0
k8s.io/api v0.31.1
k8s.io/apiextensions-apiserver v0.31.1
Expand Down Expand Up @@ -113,12 +113,12 @@ require (
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/crypto v0.35.0 // indirect
golang.org/x/net v0.36.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/tools v0.28.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.35.1 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6 h1:1wqE9dj9NpSm04INVsJhhEUzhuDVjbcyKH91sVyPATw=
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand All @@ -299,16 +299,16 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -319,20 +319,20 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/clusterresourceplacement/cluster_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (r *Reconciler) selectClusters(placement *fleetv1alpha1.ClusterResourcePlac
}
klog.V(2).InfoS("we select all the available clusters in the fleet without a policy",
"placement", placement.Name, "clusters", clusterNames)
return
return clusterNames, nil
Comment thread
britaniar marked this conversation as resolved.
}
// a fix list of clusters set
if len(placement.Spec.Policy.ClusterNames) != 0 {
Expand All @@ -47,7 +47,7 @@ func (r *Reconciler) selectClusters(placement *fleetv1alpha1.ClusterResourcePlac
if err != nil {
return nil, err
}
return
return clusterNames, nil
}

// no Affinity or ClusterAffinity set
Expand All @@ -58,7 +58,7 @@ func (r *Reconciler) selectClusters(placement *fleetv1alpha1.ClusterResourcePlac
}
klog.V(2).InfoS("we select all the available clusters in the fleet without a cluster affinity",
"placement", placement.Name, "clusters", clusterNames)
return
return clusterNames, nil
}

selectedClusters := make(map[string]bool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Licensed under the MIT license.
package clusterresourceplacement

import (
"math/rand"
"testing"
"time"

Expand Down Expand Up @@ -163,15 +164,15 @@ func TestGenerateManifest(t *testing.T) {
Spec: corev1.ServiceSpec{
ClusterIP: utilrand.String(10),
ClusterIPs: []string{},
HealthCheckNodePort: int32(utilrand.Int()),
HealthCheckNodePort: rand.Int31(),
Selector: map[string]string{"svc-spec-selector-key": "svc-spec-selector-value"},
Ports: []corev1.ServicePort{
{
Name: "svc-port",
Protocol: corev1.ProtocolTCP,
AppProtocol: ptr.To("svc.com/my-custom-protocol"),
Port: 9001,
NodePort: int32(utilrand.Int()),
NodePort: rand.Int31(),
},
},
Type: corev1.ServiceType("svc-spec-type"),
Expand Down Expand Up @@ -667,15 +668,15 @@ func TestGenerateResourceContent(t *testing.T) {
Spec: corev1.ServiceSpec{
ClusterIP: utilrand.String(10),
ClusterIPs: []string{},
HealthCheckNodePort: int32(utilrand.Int()),
HealthCheckNodePort: rand.Int31(),
Selector: map[string]string{"svc-spec-selector-key": "svc-spec-selector-value"},
Ports: []corev1.ServicePort{
{
Name: "svc-port",
Protocol: corev1.ProtocolTCP,
AppProtocol: ptr.To("svc.com/my-custom-protocol"),
Port: 9001,
NodePort: int32(utilrand.Int()),
NodePort: rand.Int31(),
},
},
Type: corev1.ServiceType("svc-spec-type"),
Expand Down
44 changes: 22 additions & 22 deletions pkg/scheduler/framework/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1416,8 +1416,8 @@ func TestCrossReferencePickedClustersAndDeDupBindings(t *testing.T) {
},
},
Score: &ClusterScore{
TopologySpreadScore: int(topologySpreadScore1),
AffinityScore: int(affinityScore1),
TopologySpreadScore: topologySpreadScore1,
AffinityScore: affinityScore1,
ObsoletePlacementAffinityScore: 1,
},
},
Expand All @@ -1428,8 +1428,8 @@ func TestCrossReferencePickedClustersAndDeDupBindings(t *testing.T) {
},
},
Score: &ClusterScore{
TopologySpreadScore: int(topologySpreadScore2),
AffinityScore: int(affinityScore2),
TopologySpreadScore: topologySpreadScore2,
AffinityScore: affinityScore2,
ObsoletePlacementAffinityScore: 0,
},
},
Expand All @@ -1440,8 +1440,8 @@ func TestCrossReferencePickedClustersAndDeDupBindings(t *testing.T) {
},
},
Score: &ClusterScore{
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: int(affinityScore3),
TopologySpreadScore: topologySpreadScore3,
AffinityScore: affinityScore3,
ObsoletePlacementAffinityScore: 1,
},
},
Expand Down Expand Up @@ -2618,8 +2618,8 @@ func TestUpdatePolicySnapshotStatusFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: int(affinityScore3),
TopologySpreadScore: topologySpreadScore3,
AffinityScore: affinityScore3,
},
},
},
Expand Down Expand Up @@ -2687,8 +2687,8 @@ func TestUpdatePolicySnapshotStatusFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: int(affinityScore3),
TopologySpreadScore: topologySpreadScore3,
AffinityScore: affinityScore3,
},
},
},
Expand Down Expand Up @@ -2830,8 +2830,8 @@ func TestUpdatePolicySnapshotStatusFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
AffinityScore: int(affinityScore2),
TopologySpreadScore: int(topologySpreadScore2),
AffinityScore: affinityScore2,
TopologySpreadScore: topologySpreadScore2,
},
},
{
Expand All @@ -2841,8 +2841,8 @@ func TestUpdatePolicySnapshotStatusFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
AffinityScore: int(affinityScore3),
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: affinityScore3,
TopologySpreadScore: topologySpreadScore3,
},
},
},
Expand Down Expand Up @@ -3451,8 +3451,8 @@ func TestNewSchedulingDecisionsFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
AffinityScore: int(affinityScore3),
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: affinityScore3,
TopologySpreadScore: topologySpreadScore3,
},
},
},
Expand Down Expand Up @@ -3533,8 +3533,8 @@ func TestNewSchedulingDecisionsFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
AffinityScore: int(affinityScore3),
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: affinityScore3,
TopologySpreadScore: topologySpreadScore3,
},
},
},
Expand Down Expand Up @@ -3750,8 +3750,8 @@ func TestNewSchedulingDecisionsFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
AffinityScore: int(affinityScore3),
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: affinityScore3,
TopologySpreadScore: topologySpreadScore3,
},
},
},
Expand Down Expand Up @@ -3823,8 +3823,8 @@ func TestNewSchedulingDecisionsFromBindings(t *testing.T) {
},
},
Score: &ClusterScore{
AffinityScore: int(affinityScore3),
TopologySpreadScore: int(topologySpreadScore3),
AffinityScore: affinityScore3,
TopologySpreadScore: topologySpreadScore3,
},
},
},
Expand Down
Loading
Loading