Skip to content

Commit

Permalink
Log request on lifecycle hook update (troubleshoot why update does no…
Browse files Browse the repository at this point in the history
…t change the heartbeat timeout)
  • Loading branch information
AndiDog committed Nov 28, 2024
1 parent 3cc6daa commit 1bf7bde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cloud/services/autoscaling/lifecyclehook.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package asg

import (
"context"
"fmt"
"time"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -81,6 +82,7 @@ func getPutLifecycleHookInput(asgName string, hook *expinfrav1.AWSLifecycleHook)
func (s *Service) CreateLifecycleHook(ctx context.Context, asgName string, hook *expinfrav1.AWSLifecycleHook) error {
input := getPutLifecycleHookInput(asgName, hook)

fmt.Printf("ANDI create %+v\n", input)
if _, err := s.ASGClient.PutLifecycleHookWithContext(ctx, input); err != nil {
return errors.Wrapf(err, "failed to create lifecycle hook %q for AutoScalingGroup: %q", hook.Name, asgName)
}
Expand All @@ -92,6 +94,7 @@ func (s *Service) CreateLifecycleHook(ctx context.Context, asgName string, hook
func (s *Service) UpdateLifecycleHook(ctx context.Context, asgName string, hook *expinfrav1.AWSLifecycleHook) error {
input := getPutLifecycleHookInput(asgName, hook)

fmt.Printf("ANDI update %+v\n", input)
if _, err := s.ASGClient.PutLifecycleHookWithContext(ctx, input); err != nil {
return errors.Wrapf(err, "failed to update lifecycle hook %q for AutoScalingGroup: %q", hook.Name, asgName)
}
Expand Down

0 comments on commit 1bf7bde

Please sign in to comment.