diff --git a/pkg/clients/resourcerecordset/resourcerecordset.go b/pkg/clients/resourcerecordset/resourcerecordset.go index 66cf55832b..32fad29fd8 100644 --- a/pkg/clients/resourcerecordset/resourcerecordset.go +++ b/pkg/clients/resourcerecordset/resourcerecordset.go @@ -175,6 +175,8 @@ func LateInitialize(in *v1alpha1.ResourceRecordSetParameters, rrSet *route53type rrType := string(rrSet.Type) in.Type = pointer.LateInitializeValueFromPtr(in.Type, &rrType) in.TTL = pointer.LateInitialize(in.TTL, rrSet.TTL) + in.MultiValueAnswer = pointer.LateInitialize(in.MultiValueAnswer, rrSet.MultiValueAnswer) + in.SetIdentifier = pointer.LateInitialize(in.SetIdentifier, rrSet.SetIdentifier) if len(in.ResourceRecords) == 0 && len(rrSet.ResourceRecords) != 0 { in.ResourceRecords = make([]v1alpha1.ResourceRecord, len(rrSet.ResourceRecords)) for i, val := range rrSet.ResourceRecords { diff --git a/pkg/clients/resourcerecordset/resourcerecordset_test.go b/pkg/clients/resourcerecordset/resourcerecordset_test.go index 11a5e7d44f..701a2cc268 100644 --- a/pkg/clients/resourcerecordset/resourcerecordset_test.go +++ b/pkg/clients/resourcerecordset/resourcerecordset_test.go @@ -59,19 +59,43 @@ func TestCreatePatch(t *testing.T) { patch: &v1alpha1.ResourceRecordSetParameters{}, }, }, + "SameFieldsWithMultiValueAnswer": { + args: args{ + rrSet: route53types.ResourceRecordSet{ + Name: &resourceRecordSetName, + TTL: &ttl, + MultiValueAnswer: aws.Bool(true), + SetIdentifier: aws.String("id"), + }, + p: v1alpha1.ResourceRecordSetParameters{ + TTL: &ttl, + MultiValueAnswer: aws.Bool(true), + SetIdentifier: aws.String("id"), + }, + }, + want: want{ + patch: &v1alpha1.ResourceRecordSetParameters{}, + }, + }, "DifferentFields": { args: args{ rrSet: route53types.ResourceRecordSet{ - Name: &resourceRecordSetName, - TTL: &ttl, + Name: &resourceRecordSetName, + TTL: &ttl, + MultiValueAnswer: aws.Bool(true), + SetIdentifier: aws.String("id"), }, p: v1alpha1.ResourceRecordSetParameters{ - TTL: &ttl2, + TTL: &ttl2, + MultiValueAnswer: aws.Bool(false), + SetIdentifier: aws.String("id2"), }, }, want: want{ patch: &v1alpha1.ResourceRecordSetParameters{ - TTL: &ttl2, + TTL: &ttl2, + MultiValueAnswer: aws.Bool(false), + SetIdentifier: aws.String("id2"), }, }, },