From 4a85bf67d81b88e78ec5336d32fb47f1afeddf0e Mon Sep 17 00:00:00 2001 From: Neha Bhat <84361901+ndbhat@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:18:51 -0400 Subject: [PATCH] Update CertificateAuthority customSetDefaults method (#54) Description of changes: 1. Set fields of `a` to the fields of `b` in customSetDefaults method By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --- pkg/resource/certificate_authority/custom_delta.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/resource/certificate_authority/custom_delta.go b/pkg/resource/certificate_authority/custom_delta.go index decef94..79a1972 100644 --- a/pkg/resource/certificate_authority/custom_delta.go +++ b/pkg/resource/certificate_authority/custom_delta.go @@ -16,25 +16,18 @@ package certificate_authority import ( svcapitypes "github.com/aws-controllers-k8s/acmpca-controller/apis/v1alpha1" ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare" - "github.com/aws/aws-sdk-go/aws" ) func customSetDefaults( a *resource, b *resource, ) { - // Default value of UsageMode is GENERAL_PURPOSE - defaultUsageMode := aws.String("GENERAL_PURPOSE") - if ackcompare.IsNil(a.ko.Spec.UsageMode) && ackcompare.IsNotNil(b.ko.Spec.UsageMode) { - a.ko.Spec.UsageMode = defaultUsageMode + a.ko.Spec.UsageMode = b.ko.Spec.UsageMode } - // Default value of KeyStorageSecurityStandard is FIPS_140_2_LEVEL_3_OR_HIGHER - defaultKeyStorageSecurityStandard := aws.String("FIPS_140_2_LEVEL_3_OR_HIGHER") - if ackcompare.IsNil(a.ko.Spec.KeyStorageSecurityStandard) && ackcompare.IsNotNil(b.ko.Spec.KeyStorageSecurityStandard) { - a.ko.Spec.KeyStorageSecurityStandard = defaultKeyStorageSecurityStandard + a.ko.Spec.KeyStorageSecurityStandard = b.ko.Spec.KeyStorageSecurityStandard } if ackcompare.IsNil(a.ko.Spec.RevocationConfiguration) && ackcompare.IsNotNil(b.ko.Spec.RevocationConfiguration) {