From 4fd675c22ad97d64c7215e39145b62eb45bb0a05 Mon Sep 17 00:00:00 2001 From: Andreas Sommer Date: Wed, 20 Nov 2024 23:02:59 +0100 Subject: [PATCH] Fix lints --- pkg/cloud/scope/machinepool.go | 1 + pkg/cloud/scope/managednodegroup.go | 5 +++-- pkg/cloud/services/autoscaling/lifecyclehook.go | 2 +- pkg/cloud/services/eks/nodegroup.go | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/cloud/scope/machinepool.go b/pkg/cloud/scope/machinepool.go index 8fe2d2cecb..affd68513b 100644 --- a/pkg/cloud/scope/machinepool.go +++ b/pkg/cloud/scope/machinepool.go @@ -396,6 +396,7 @@ func (m *MachinePoolScope) GetRuntimeObject() runtime.Object { return m.AWSMachinePool } +// GetLifecycleHooks returns the desired lifecycle hooks for the ASG. func (m *MachinePoolScope) GetLifecycleHooks() []expinfrav1.AWSLifecycleHook { return m.AWSMachinePool.Spec.AWSLifecycleHooks } diff --git a/pkg/cloud/scope/managednodegroup.go b/pkg/cloud/scope/managednodegroup.go index ab7c2761f8..c091f02efe 100644 --- a/pkg/cloud/scope/managednodegroup.go +++ b/pkg/cloud/scope/managednodegroup.go @@ -412,6 +412,7 @@ func (s *ManagedMachinePoolScope) GetRuntimeObject() runtime.Object { return s.ManagedMachinePool } -func (m *ManagedMachinePoolScope) GetLifecycleHooks() []expinfrav1.AWSLifecycleHook { - return m.ManagedMachinePool.Spec.AWSLifecycleHooks +// GetLifecycleHooks returns the desired lifecycle hooks for the ASG. +func (s *ManagedMachinePoolScope) GetLifecycleHooks() []expinfrav1.AWSLifecycleHook { + return s.ManagedMachinePool.Spec.AWSLifecycleHooks } diff --git a/pkg/cloud/services/autoscaling/lifecyclehook.go b/pkg/cloud/services/autoscaling/lifecyclehook.go index 8cc2385441..b0fa055d96 100644 --- a/pkg/cloud/services/autoscaling/lifecyclehook.go +++ b/pkg/cloud/services/autoscaling/lifecyclehook.go @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" ) -// GetLifecycleHooks returns the lifecycle hooks for the given AutoScalingGroup after retrieving them from the AWS API. +// DescribeLifecycleHooks returns the lifecycle hooks for the given AutoScalingGroup after retrieving them from the AWS API. func (s *Service) DescribeLifecycleHooks(asgName string) ([]*expinfrav1.AWSLifecycleHook, error) { input := &autoscaling.DescribeLifecycleHooksInput{ AutoScalingGroupName: aws.String(asgName), diff --git a/pkg/cloud/services/eks/nodegroup.go b/pkg/cloud/services/eks/nodegroup.go index 239b884299..70cd05ad73 100644 --- a/pkg/cloud/services/eks/nodegroup.go +++ b/pkg/cloud/services/eks/nodegroup.go @@ -41,7 +41,8 @@ import ( "sigs.k8s.io/cluster-api/util/annotations" ) -// Built-in EKS lifecycle hooks should not be changed +// IgnoredEKSLifecycleHooks lists built-in EKS lifecycle hooks +// that should not be changed or deleted. var IgnoredEKSLifecycleHooks = map[string]bool{ "Launch-LC-Hook": true, "Terminate-LC-Hook": true,