From af3b0d6263fbe2111e7b0b0fe96e66bde15c67ec Mon Sep 17 00:00:00 2001 From: bob Date: Mon, 23 Jan 2023 18:13:36 +0100 Subject: [PATCH] [aws] - Fix mistake during cherry pick datadog:patch --- staging/src/k8s.io/legacy-cloud-providers/aws/aws.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go b/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go index 1d9880c70cba9..baf5a71f019d3 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go +++ b/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go @@ -1892,12 +1892,12 @@ func isAWSErrorInstanceNotFound(err error) bool { if awsError, ok := err.(awserr.Error); ok { if awsError.Code() == ec2.UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdNotFound { return true - } else if strings.Contains(err.Error(), ec2.UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdNotFound) { + } + } else if strings.Contains(err.Error(), ec2.UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdNotFound) { // In places like https://github.com/kubernetes/cloud-provider-aws/blob/1c6194aad0122ab44504de64187e3d1a7415b198/pkg/providers/v1/aws.go#L1007, // the error has been transformed into something else so check the error string to see if it contains the error code we're looking for. - return true - } - } + return true + } return false }