Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update minor dependencies (master) #2773

Merged
merged 2 commits into from
Aug 30, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion app/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/gorilla/handlers"
"github.com/pkg/errors"
"github.com/rancher/wrangler/pkg/signals"
"github.com/rancher/wrangler/v3/pkg/signals"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
7 changes: 4 additions & 3 deletions controller/base_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ var (
type baseController struct {
name string
logger *logrus.Entry
queue workqueue.RateLimitingInterface
queue workqueue.TypedRateLimitingInterface[any]
}

func newBaseController(name string, logger logrus.FieldLogger) *baseController {
nameConfig := workqueue.TypedRateLimitingQueueConfig[any]{Name: name}
return newBaseControllerWithQueue(name, logger,
workqueue.NewNamedRateLimitingQueue(EnhancedDefaultControllerRateLimiter(), name))
workqueue.NewTypedRateLimitingQueueWithConfig[any](EnhancedDefaultControllerRateLimiter(), nameConfig))
}

func newBaseControllerWithQueue(name string, logger logrus.FieldLogger,
queue workqueue.RateLimitingInterface) *baseController {
queue workqueue.TypedRateLimitingInterface[any]) *baseController {
c := &baseController{
name: name,
logger: logger.WithField("controller", name),
Expand Down
8 changes: 4 additions & 4 deletions controller/controller_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ func isControllerResponsibleFor(controllerID string, ds *datastore.DataStore, na

// EnhancedDefaultControllerRateLimiter is an enhanced version of workqueue.DefaultControllerRateLimiter()
// See https://github.com/longhorn/longhorn/issues/1058 for details
func EnhancedDefaultControllerRateLimiter() workqueue.RateLimiter {
return workqueue.NewMaxOfRateLimiter(
workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 1000*time.Second),
func EnhancedDefaultControllerRateLimiter() workqueue.TypedRateLimiter[any] {
return workqueue.NewTypedMaxOfRateLimiter[any](
workqueue.NewTypedItemExponentialFailureRateLimiter[any](5*time.Millisecond, 1000*time.Second),
// 100 qps, 1000 bucket size
&workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(100), 1000)},
&workqueue.TypedBucketRateLimiter[any]{Limiter: rate.NewLimiter(rate.Limit(100), 1000)},
)
}

Expand Down
12 changes: 6 additions & 6 deletions controller/monitor/snapshot_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ type SnapshotMonitor struct {

checkScheduler *gocron.Scheduler

snapshotChangeEventQueue workqueue.Interface
snapshotCheckTaskQueue workqueue.RateLimitingInterface
snapshotChangeEventQueue workqueue.TypedInterface[any]
snapshotCheckTaskQueue workqueue.TypedRateLimitingInterface[any]

inProgressSnapshotCheckTasks map[string]struct{}
inProgressSnapshotCheckTasksLock sync.RWMutex
Expand All @@ -86,7 +86,7 @@ type SnapshotMonitor struct {
}

func NewSnapshotMonitor(logger logrus.FieldLogger, ds *datastore.DataStore, nodeName string, eventRecorder record.EventRecorder,
snapshotChangeEventQueue workqueue.Interface, syncCallback func(key string)) (*SnapshotMonitor, error) {
snapshotChangeEventQueue workqueue.TypedInterface[any], syncCallback func(key string)) (*SnapshotMonitor, error) {

ctx, quit := context.WithCancel(context.Background())

Expand All @@ -101,9 +101,9 @@ func NewSnapshotMonitor(logger logrus.FieldLogger, ds *datastore.DataStore, node

snapshotChangeEventQueue: snapshotChangeEventQueue,

snapshotCheckTaskQueue: workqueue.NewRateLimitingQueue(workqueue.NewMaxOfRateLimiter(
workqueue.NewItemExponentialFailureRateLimiter(1*time.Second, 1000*time.Second),
&workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)},
snapshotCheckTaskQueue: workqueue.NewTypedRateLimitingQueue[any](workqueue.NewTypedMaxOfRateLimiter[any](
workqueue.NewTypedItemExponentialFailureRateLimiter[any](1*time.Second, 1000*time.Second),
&workqueue.TypedBucketRateLimiter[any]{Limiter: rate.NewLimiter(rate.Limit(10), 100)},
)),

inProgressSnapshotCheckTasks: map[string]struct{}{},
Expand Down
4 changes: 2 additions & 2 deletions controller/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type NodeController struct {
diskMonitor monitor.Monitor

snapshotMonitor monitor.Monitor
snapshotChangeEventQueue workqueue.Interface
snapshotChangeEventQueue workqueue.TypedInterface[any]
snapshotChangeEventQueueLock sync.Mutex

ds *datastore.DataStore
Expand Down Expand Up @@ -102,7 +102,7 @@ func NewNodeController(

topologyLabelsChecker: util.IsKubernetesVersionAtLeast,

snapshotChangeEventQueue: workqueue.New(),
snapshotChangeEventQueue: workqueue.NewTyped[any](),
}

nc.scheduler = scheduler.NewReplicaScheduler(ds)
Expand Down
9 changes: 5 additions & 4 deletions controller/system_rollout_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ func NewSystemRolloutController(
Interface: v1core.New(kubeClient.CoreV1().RESTClient()).Events(""),
})

nameConfig := workqueue.TypedRateLimitingQueueConfig[any]{Name: SystemRolloutControllerName}
c := &SystemRolloutController{
baseController: newBaseControllerWithQueue(SystemRolloutControllerName, logger,
workqueue.NewNamedRateLimitingQueue(workqueue.NewMaxOfRateLimiter(
workqueue.NewItemExponentialFailureRateLimiter(100*time.Millisecond, 2*time.Second),
&workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(100), 1000)},
), SystemRolloutControllerName),
workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.NewTypedMaxOfRateLimiter[any](
workqueue.NewTypedItemExponentialFailureRateLimiter[any](100*time.Millisecond, 2*time.Second),
&workqueue.TypedBucketRateLimiter[any]{Limiter: rate.NewLimiter(rate.Limit(100), 1000)},
), nameConfig),
),
controllerID: controllerID,
stopCh: stopCh,
Expand Down
9 changes: 5 additions & 4 deletions controller/uninstall_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ func NewUninstallController(
kubeClient clientset.Interface,
extensionsClient apiextensionsclientset.Interface,
) (*UninstallController, error) {
nameConfig := workqueue.TypedRateLimitingQueueConfig[any]{Name: "longhorn-uninstall"}
c := &UninstallController{
baseController: newBaseControllerWithQueue("longhorn-uninstall", logger,
workqueue.NewNamedRateLimitingQueue(workqueue.NewMaxOfRateLimiter(
workqueue.NewItemExponentialFailureRateLimiter(100*time.Millisecond, 2*time.Second),
&workqueue.BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(100), 1000)},
), "longhorn-uninstall"),
workqueue.NewTypedRateLimitingQueueWithConfig[any](workqueue.NewTypedMaxOfRateLimiter[any](
workqueue.NewTypedItemExponentialFailureRateLimiter[any](100*time.Millisecond, 2*time.Second),
&workqueue.TypedBucketRateLimiter[any]{Limiter: rate.NewLimiter(rate.Limit(100), 1000)},
), nameConfig),
),
namespace: namespace,
force: force,
Expand Down
3 changes: 2 additions & 1 deletion csi/controller_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (
)

type ControllerServer struct {
csi.UnimplementedControllerServer
apiClient *longhornclient.RancherClient
nodeID string
caps []*csi.ControllerServiceCapability
Expand Down Expand Up @@ -1380,7 +1381,7 @@ func (cs *ControllerServer) waitForSnapshotToBeReady(snapshotName, volumeName st

func (cs *ControllerServer) ControllerModifyVolume(ctx context.Context, req *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error) {
log := cs.log.WithFields(logrus.Fields{"function": "ControllerModifyVolume"})
log.Infof("ControllerModifyVolume: called with args %+v", *req)
log.Infof("ControllerModifyVolume: called with args %v", req)

return nil, status.Error(codes.Unimplemented, "")
}
1 change: 1 addition & 0 deletions csi/identity_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

type IdentityServer struct {
csi.UnimplementedIdentityServer
driverName string
version string
}
Expand Down
1 change: 1 addition & 0 deletions csi/node_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var supportedFs = map[string]fsParameters{
}

type NodeServer struct {
csi.UnimplementedNodeServer
apiClient *longhornclient.RancherClient
nodeID string
caps []*csi.NodeServiceCapability
Expand Down
Loading