From 5e3faad7c2571b9e0c035fa7df1f3fe2d4bf73fd Mon Sep 17 00:00:00 2001 From: Martin Guibert Date: Wed, 19 May 2021 16:45:41 +0200 Subject: [PATCH] fix policy not deleted when empty --- pkg/middlewares/aws_sqs_queue_policy_expander.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/middlewares/aws_sqs_queue_policy_expander.go b/pkg/middlewares/aws_sqs_queue_policy_expander.go index 93140765..7ce3c6b5 100644 --- a/pkg/middlewares/aws_sqs_queue_policy_expander.go +++ b/pkg/middlewares/aws_sqs_queue_policy_expander.go @@ -62,6 +62,7 @@ func (m AwsSqsQueuePolicyExpander) Execute(remoteResources, resourcesFromState * func (m *AwsSqsQueuePolicyExpander) handlePolicy(queue *resource.AbstractResource, results *[]resource.Resource) error { policy, exists := queue.Attrs.Get("policy") if !exists || policy.(string) == "" { + queue.Attrs.SafeDelete([]string{"policy"}) return nil }