diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index e46cee37..ba643af3 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,13 +1,13 @@ ack_generate_info: - build_date: "2022-03-31T20:42:48Z" - build_hash: c4516f46370293aa38f56d01393b7216f5902886 + build_date: "2022-04-05T21:45:17Z" + build_hash: fc5620cf5fde243ee5124324d26bb7e952049bf2 go_version: go1.17.5 - version: v0.18.2 -api_directory_checksum: e5bf2003f6be051fdeda5059df47eb7fff0a9c86 + version: v0.18.3 +api_directory_checksum: 35ef0e4da69ded8c1fa7a4a6029510864a1069af api_version: v1alpha1 aws_sdk_go_version: v1.42.0 generator_config_info: - file_checksum: 8bcbefb7a9f69e907e36562fc8d2e9c11e74cf28 + file_checksum: 32301fc646db64b7beb3541310c727da6b6d8dc5 original_file_name: generator.yaml last_modification: reason: API generation diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index 5b2d422a..c28f07d3 100644 --- a/config/controller/kustomization.yaml +++ b/config/controller/kustomization.yaml @@ -6,4 +6,4 @@ kind: Kustomization images: - name: controller newName: public.ecr.aws/aws-controllers-k8s/ec2-controller - newTag: v0.0.13 + newTag: v0.0.14 diff --git a/go.mod b/go.mod index 4c7efb88..877e4f47 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/ec2-controller go 1.17 require ( - github.com/aws-controllers-k8s/runtime v0.18.1 + github.com/aws-controllers-k8s/runtime v0.18.3 github.com/aws/aws-sdk-go v1.42.0 github.com/go-logr/logr v1.2.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 5779d96c..9ebab6e4 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws-controllers-k8s/runtime v0.18.1 h1:eHmW7ObuGqnz/QpOKnZqHY2QuZmk8uROyXOvqKc7WjY= -github.com/aws-controllers-k8s/runtime v0.18.1/go.mod h1:pK+LlQRxxWKC9mRHnGz8/WRI8Dcvjg4ZGmK8rVwb51Y= +github.com/aws-controllers-k8s/runtime v0.18.3 h1:8U/lqvW7NwRiyMnx/yk1hxrjDs0NONfAHWYE1bvhx/E= +github.com/aws-controllers-k8s/runtime v0.18.3/go.mod h1:pK+LlQRxxWKC9mRHnGz8/WRI8Dcvjg4ZGmK8rVwb51Y= github.com/aws/aws-sdk-go v1.42.0 h1:BMZws0t8NAhHFsfnT3B40IwD13jVDG5KerlRksctVIw= github.com/aws/aws-sdk-go v1.42.0/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 856a8b5b..32efc4c2 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: ec2-chart description: A Helm chart for the ACK service controller for Amazon Elastic Cloud Compute (EC2) -version: v0.0.13 -appVersion: v0.0.13 +version: v0.0.14 +appVersion: v0.0.14 home: https://github.com/aws-controllers-k8s/ec2-controller icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png sources: diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt index b9c9dc3c..4339dfc6 100644 --- a/helm/templates/NOTES.txt +++ b/helm/templates/NOTES.txt @@ -1,5 +1,5 @@ {{ .Chart.Name }} has been installed. -This chart deploys "public.ecr.aws/aws-controllers-k8s/ec2-controller:v0.0.13". +This chart deploys "public.ecr.aws/aws-controllers-k8s/ec2-controller:v0.0.14". Check its status by running: kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}" diff --git a/helm/values.yaml b/helm/values.yaml index 23940337..2980ea84 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/ec2-controller - tag: v0.0.13 + tag: v0.0.14 pullPolicy: IfNotPresent pullSecrets: [] diff --git a/pkg/resource/dhcp_options/sdk.go b/pkg/resource/dhcp_options/sdk.go index 016ff275..9d54d5c9 100644 --- a/pkg/resource/dhcp_options/sdk.go +++ b/pkg/resource/dhcp_options/sdk.go @@ -17,6 +17,7 @@ package dhcp_options import ( "context" + "errors" "reflect" "strings" @@ -394,8 +395,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -403,7 +404,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/elastic_ip_address/sdk.go b/pkg/resource/elastic_ip_address/sdk.go index eb63277a..db06ebb6 100644 --- a/pkg/resource/elastic_ip_address/sdk.go +++ b/pkg/resource/elastic_ip_address/sdk.go @@ -17,6 +17,7 @@ package elastic_ip_address import ( "context" + "errors" "reflect" "strings" @@ -377,8 +378,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -386,7 +387,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/internet_gateway/sdk.go b/pkg/resource/internet_gateway/sdk.go index 1a0f1ae8..af7777f0 100644 --- a/pkg/resource/internet_gateway/sdk.go +++ b/pkg/resource/internet_gateway/sdk.go @@ -17,6 +17,7 @@ package internet_gateway import ( "context" + "errors" "reflect" "strings" @@ -373,8 +374,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -382,7 +383,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/nat_gateway/sdk.go b/pkg/resource/nat_gateway/sdk.go index d1903672..ac93ce0d 100644 --- a/pkg/resource/nat_gateway/sdk.go +++ b/pkg/resource/nat_gateway/sdk.go @@ -17,6 +17,7 @@ package nat_gateway import ( "context" + "errors" "reflect" "strings" @@ -491,8 +492,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -500,7 +501,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/route_table/sdk.go b/pkg/resource/route_table/sdk.go index cdd9b549..b4c863fb 100644 --- a/pkg/resource/route_table/sdk.go +++ b/pkg/resource/route_table/sdk.go @@ -17,6 +17,7 @@ package route_table import ( "context" + "errors" "reflect" "strings" @@ -544,8 +545,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -553,7 +554,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/security_group/sdk.go b/pkg/resource/security_group/sdk.go index 6395d29c..186d862d 100644 --- a/pkg/resource/security_group/sdk.go +++ b/pkg/resource/security_group/sdk.go @@ -17,6 +17,7 @@ package security_group import ( "context" + "errors" "reflect" "strings" @@ -330,8 +331,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -339,7 +340,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/subnet/sdk.go b/pkg/resource/subnet/sdk.go index 5dca5270..35534fdf 100644 --- a/pkg/resource/subnet/sdk.go +++ b/pkg/resource/subnet/sdk.go @@ -17,6 +17,7 @@ package subnet import ( "context" + "errors" "reflect" "strings" @@ -541,8 +542,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -550,7 +551,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/transit_gateway/sdk.go b/pkg/resource/transit_gateway/sdk.go index 5a2e04df..a8053e94 100644 --- a/pkg/resource/transit_gateway/sdk.go +++ b/pkg/resource/transit_gateway/sdk.go @@ -17,6 +17,7 @@ package transit_gateway import ( "context" + "errors" "reflect" "strings" @@ -479,8 +480,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -488,7 +489,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/vpc/sdk.go b/pkg/resource/vpc/sdk.go index 644639ba..b0df9e09 100644 --- a/pkg/resource/vpc/sdk.go +++ b/pkg/resource/vpc/sdk.go @@ -17,6 +17,7 @@ package vpc import ( "context" + "errors" "reflect" "strings" @@ -519,8 +520,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -528,7 +529,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err) diff --git a/pkg/resource/vpc_endpoint/sdk.go b/pkg/resource/vpc_endpoint/sdk.go index 714a3d6e..9dd8bf00 100644 --- a/pkg/resource/vpc_endpoint/sdk.go +++ b/pkg/resource/vpc_endpoint/sdk.go @@ -17,6 +17,7 @@ package vpc_endpoint import ( "context" + "errors" "reflect" "strings" @@ -604,8 +605,8 @@ func (rm *resourceManager) updateConditions( syncCondition = condition } } - - if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + var termError *ackerr.TerminalError + if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { if terminalCondition == nil { terminalCondition = &ackv1alpha1.Condition{ Type: ackv1alpha1.ConditionTypeTerminal, @@ -613,7 +614,7 @@ func (rm *resourceManager) updateConditions( ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition) } var errorMessage = "" - if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound { + if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) { errorMessage = err.Error() } else { awsErr, _ := ackerr.AWSError(err)