Skip to content

Commit

Permalink
update comment on target lifecycle 404 response
Browse files Browse the repository at this point in the history
  • Loading branch information
pete911 committed May 23, 2023
1 parent fa9eaa3 commit 2ff59b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ec2metadata/ec2metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (e *Service) GetRebalanceRecommendationEvent() (rebalanceRec *RebalanceReco
// if the lifecycle hook is not present on the ASG
func (e *Service) GetASGTargetLifecycleState() (state string, err error) {
resp, err := e.Request(ASGTargetLifecycleStatePath)
// 404s are normal when querying for the 'autoscaling/target-lifecycle-state' path and there is no lifecycle hook
// 404s should not happen, but there can be a case if the instance is brand new and the field is not populated yet
if resp != nil && resp.StatusCode == 404 {
return "", nil
} else if resp != nil && (resp.StatusCode < 200 || resp.StatusCode >= 300) {
Expand Down

0 comments on commit 2ff59b9

Please sign in to comment.