From 1f49401f92f603d5284a9ba0b9fb3ebdbdf017e5 Mon Sep 17 00:00:00 2001 From: Qiaozp Date: Tue, 16 Aug 2022 15:06:16 +0800 Subject: [PATCH] fix test Signed-off-by: Qiaozp --- controllers/configuration_controller_test.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/controllers/configuration_controller_test.go b/controllers/configuration_controller_test.go index 12f2ebdf..1fae88aa 100644 --- a/controllers/configuration_controller_test.go +++ b/controllers/configuration_controller_test.go @@ -1384,9 +1384,9 @@ func TestTerraformDestroy(t *testing.T) { }, VariableSecretName: fmt.Sprintf(TFVariableSecret, secretSuffix), ConfigurationCMName: configurationCMName, + // True is default value if user ignores configuration.Spec.DeleteResource + DeleteResource: true, } - metaWithDeleteResource := baseMeta - metaWithDeleteResource.DeleteResource = true metaWithLegacyResource := baseMeta metaWithLegacyResource.LegacySubResources = LegacySubResources{ Namespace: legacyNamespace, @@ -1443,16 +1443,6 @@ func TestTerraformDestroy(t *testing.T) { objects: []client.Object{readyProvider, baseConfiguration, baseConfigurationCM}, keptResources: []client.Object{baseConfigurationCM}, }, - { - name: "set DeleteResource, directly clean resources", - args: args{ - configuration: baseConfiguration, - meta: &metaWithDeleteResource, - }, - want: want{}, - objects: []client.Object{readyProvider, baseConfiguration, baseConfigurationCM}, - deletedResources: []client.Object{baseConfigurationCM}, - }, { name: "provider is not ready, cloud resource couldn't be created, delete directly", args: args{