Skip to content

Commit dd870dc

Browse files
committed
chore(lint): Replace interface{} with any
1 parent a8a2cd5 commit dd870dc

File tree

25 files changed

+92
-92
lines changed

25 files changed

+92
-92
lines changed

docs/development/machine_error_codes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ to be supplied as the `ProviderSpecificMachineClass`. The provider is responsibl
451451
type GenerateMachineClassForMigrationRequest struct {
452452
// ProviderSpecificMachineClass is provider specfic machine class object.
453453
// E.g. AWSMachineClass
454-
ProviderSpecificMachineClass interface{}
454+
ProviderSpecificMachineClass any
455455
// MachineClass is the machine class object generated that is to be filled up
456456
MachineClass *v1alpha1.MachineClass
457457
// ClassSpec contains the class spec object to determine the machineClass kind

pkg/client/listers/machine/v1alpha1/machine.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/listers/machine/v1alpha1/machineclass.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/listers/machine/v1alpha1/machinedeployment.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/listers/machine/v1alpha1/machineset.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/controller/controller_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func NoResyncPeriodFunc() time.Duration {
132132
// * Controllers that don't set expectations will get woken up for every matching controllee
133133

134134
// ExpKeyFunc to parse out the key from a ControlleeExpectation
135-
var ExpKeyFunc = func(obj interface{}) (string, error) {
135+
var ExpKeyFunc = func(obj any) (string, error) {
136136
if e, ok := obj.(*ControlleeExpectations); ok {
137137
return e.key, nil
138138
}
@@ -300,7 +300,7 @@ func NewContExpectations() *ContExpectations {
300300
}
301301

302302
// UIDSetKeyFunc to parse out the key from a UIDSet.
303-
var UIDSetKeyFunc = func(obj interface{}) (string, error) {
303+
var UIDSetKeyFunc = func(obj any) (string, error) {
304304
if u, ok := obj.(*UIDSet); ok {
305305
return u.key, nil
306306
}

pkg/controller/deployment.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ var controllerKind = v1alpha1.SchemeGroupVersion.WithKind("MachineDeployment")
5252
// GroupVersionKind is the version kind used to identify objects managed by machine-controller-manager
5353
var GroupVersionKind = "machine.sapcloud.io/v1alpha1"
5454

55-
func (dc *controller) addMachineDeployment(obj interface{}) {
55+
func (dc *controller) addMachineDeployment(obj any) {
5656
d := obj.(*v1alpha1.MachineDeployment)
5757
klog.V(4).Infof("Adding machine deployment %s", d.Name)
5858
dc.enqueueMachineDeployment(d)
5959
}
6060

61-
func (dc *controller) updateMachineDeployment(old, cur interface{}) {
61+
func (dc *controller) updateMachineDeployment(old, cur any) {
6262
oldD := old.(*v1alpha1.MachineDeployment)
6363
curD := cur.(*v1alpha1.MachineDeployment)
6464
klog.V(4).Infof("Updating machine deployment %s", oldD.Name)
6565
dc.enqueueMachineDeployment(curD)
6666
}
6767

68-
func (dc *controller) deleteMachineDeployment(obj interface{}) {
68+
func (dc *controller) deleteMachineDeployment(obj any) {
6969
d, ok := obj.(*v1alpha1.MachineDeployment)
7070
if !ok {
7171
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
@@ -84,7 +84,7 @@ func (dc *controller) deleteMachineDeployment(obj interface{}) {
8484
}
8585

8686
// addMachineSet enqueues the deployment that manages a MachineSet when the MachineSet is created.
87-
func (dc *controller) addMachineSetToDeployment(obj interface{}) {
87+
func (dc *controller) addMachineSetToDeployment(obj any) {
8888
is := obj.(*v1alpha1.MachineSet)
8989

9090
if is.DeletionTimestamp != nil {
@@ -141,7 +141,7 @@ func (dc *controller) getMachineDeploymentsForMachineSet(machineSet *v1alpha1.Ma
141141
// is updated and wake them up. If the anything of the MachineSets have changed, we need to
142142
// awaken both the old and new deployments. old and cur must be *extensions.MachineSet
143143
// types.
144-
func (dc *controller) updateMachineSetToDeployment(old, cur interface{}) {
144+
func (dc *controller) updateMachineSetToDeployment(old, cur any) {
145145
curMachineSet := cur.(*v1alpha1.MachineSet)
146146
oldMachineSet := old.(*v1alpha1.MachineSet)
147147
if curMachineSet.ResourceVersion == oldMachineSet.ResourceVersion {
@@ -189,7 +189,7 @@ func (dc *controller) updateMachineSetToDeployment(old, cur interface{}) {
189189
// deleteMachineSet enqueues the deployment that manages a MachineSet when
190190
// the MachineSet is deleted. obj could be an *v1alpha1.MachineSet, or
191191
// a DeletionFinalStateUnknown marker item.
192-
func (dc *controller) deleteMachineSetToDeployment(obj interface{}) {
192+
func (dc *controller) deleteMachineSetToDeployment(obj any) {
193193
machineSet, ok := obj.(*v1alpha1.MachineSet)
194194

195195
// When a delete is dropped, the relist will notice a Machine in the store not
@@ -249,7 +249,7 @@ func (dc *controller) updateMachineToMachineDeployment(old, cur any) {
249249
}
250250

251251
// deleteMachine will enqueue a Recreate Deployment once all of its Machines have stopped running.
252-
func (dc *controller) deleteMachineToMachineDeployment(ctx context.Context, obj interface{}) {
252+
func (dc *controller) deleteMachineToMachineDeployment(ctx context.Context, obj any) {
253253
machine, ok := obj.(*v1alpha1.Machine)
254254

255255
// When a delete is dropped, the relist will notice a Machine in the store not

pkg/controller/deployment_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type MachineDeploymentListerExpansion interface {
5959
}
6060

6161
// MachineDeploymentNamespaceListerExpansion allows custom methods to be added to MachineDeploymentNamespaceLister.
62-
type MachineDeploymentNamespaceListerExpansion interface{}
62+
type MachineDeploymentNamespaceListerExpansion any
6363

6464
// GetMachineDeploymentsForMachineSet returns a list of Deployments that potentially
6565
// match a MachineSet. Only the one specified in the MachineSet's ControllerRef

pkg/controller/machine_safety.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,13 @@ func (c *controller) checkAndFreezeORUnfreezeMachineSets(ctx context.Context) er
285285
}
286286

287287
// addMachineToSafetyOvershooting enqueues into machineSafetyOvershootingQueue when a new machine is added
288-
func (c *controller) addMachineToSafetyOvershooting(obj interface{}) {
288+
func (c *controller) addMachineToSafetyOvershooting(obj any) {
289289
machine := obj.(*v1alpha1.Machine)
290290
c.enqueueMachineSafetyOvershootingKey(machine)
291291
}
292292

293293
// enqueueMachineSafetyOvershootingKey enqueues into machineSafetyOvershootingQueue
294-
func (c *controller) enqueueMachineSafetyOvershootingKey(_ interface{}) {
294+
func (c *controller) enqueueMachineSafetyOvershootingKey(_ any) {
295295
c.machineSafetyOvershootingQueue.Add("")
296296
}
297297

pkg/controller/machineset.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (c *controller) resolveMachineSetControllerRef(namespace string, controller
134134
}
135135

136136
// callback when MachineSet is updated
137-
func (c *controller) machineSetUpdate(old, cur interface{}) {
137+
func (c *controller) machineSetUpdate(old, cur any) {
138138
oldMachineSet := old.(*v1alpha1.MachineSet)
139139
currentMachineSet := cur.(*v1alpha1.MachineSet)
140140

@@ -157,7 +157,7 @@ func (c *controller) machineSetUpdate(old, cur interface{}) {
157157
}
158158

159159
// When a machine is created, enqueue the machine set that manages it and update its expectations.
160-
func (c *controller) addMachineToMachineSet(obj interface{}) {
160+
func (c *controller) addMachineToMachineSet(obj any) {
161161
machine := obj.(*v1alpha1.Machine)
162162

163163
if machine.DeletionTimestamp != nil {
@@ -203,7 +203,7 @@ func (c *controller) addMachineToMachineSet(obj interface{}) {
203203
// When a machine is updated, figure out what machine set/s manage it and wake them
204204
// up. If the labels of the machine have changed we need to awaken both the old
205205
// and new machine set. old and cur must be *v1alpha1.Machine types.
206-
func (c *controller) updateMachineToMachineSet(old, cur interface{}) {
206+
func (c *controller) updateMachineToMachineSet(old, cur any) {
207207
curMachine := cur.(*v1alpha1.Machine)
208208
oldMachine := old.(*v1alpha1.Machine)
209209
if curMachine.ResourceVersion == oldMachine.ResourceVersion {
@@ -267,7 +267,7 @@ func (c *controller) updateMachineToMachineSet(old, cur interface{}) {
267267

268268
// When a machine is deleted, enqueue the machine set that manages the machine and update its expectations.
269269
// obj could be an *v1alpha1.Machine, or a DeletionFinalStateUnknown marker item.
270-
func (c *controller) deleteMachineToMachineSet(obj interface{}) {
270+
func (c *controller) deleteMachineToMachineSet(obj any) {
271271
machine, ok := obj.(*v1alpha1.Machine)
272272

273273
// When a delete is dropped, the relist will notice a machine in the store not
@@ -306,7 +306,7 @@ func (c *controller) deleteMachineToMachineSet(obj interface{}) {
306306
}
307307

308308
// obj could be an *extensions.MachineSet, or a DeletionFinalStateUnknown marker item.
309-
func (c *controller) enqueueMachineSet(obj interface{}) {
309+
func (c *controller) enqueueMachineSet(obj any) {
310310
key, err := KeyFunc(obj)
311311
if err != nil {
312312
utilruntime.HandleError(fmt.Errorf("couldn't get key for object %+v: %v", obj, err))
@@ -316,7 +316,7 @@ func (c *controller) enqueueMachineSet(obj interface{}) {
316316
}
317317

318318
// obj could be an *extensions.MachineSet, or a DeletionFinalStateUnknown marker item.
319-
func (c *controller) enqueueMachineSetAfter(obj interface{}, after time.Duration) {
319+
func (c *controller) enqueueMachineSetAfter(obj any, after time.Duration) {
320320
key, err := KeyFunc(obj)
321321
if err != nil {
322322
utilruntime.HandleError(fmt.Errorf("couldn't get key for object %+v: %v", obj, err))

0 commit comments

Comments
 (0)