Skip to content

Commit faca85a

Browse files
authored
Fix VPC optional DNS attribute handling (#225)
Issue #: aws-controllers-k8s/community#1826 Description of changes: Only sync optional fields, if actually configured. More details are in the [commit message](3ebf6f9). By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 2cd876f commit faca85a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/resource/vpc/hooks.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,18 @@ func (rm *resourceManager) customUpdateVPC(
310310
}
311311

312312
if delta.DifferentAt("Spec.EnableDNSSupport") {
313-
if err := rm.syncDNSSupportAttribute(ctx, desired); err != nil {
314-
return nil, err
313+
if desired.ko.Spec.EnableDNSSupport != nil {
314+
if err := rm.syncDNSSupportAttribute(ctx, desired); err != nil {
315+
return nil, err
316+
}
315317
}
316318
}
317319

318320
if delta.DifferentAt("Spec.EnableDNSHostnames") {
319-
if err := rm.syncDNSHostnamesAttribute(ctx, desired); err != nil {
320-
return nil, err
321+
if desired.ko.Spec.EnableDNSHostnames != nil {
322+
if err := rm.syncDNSHostnamesAttribute(ctx, desired); err != nil {
323+
return nil, err
324+
}
321325
}
322326
}
323327

0 commit comments

Comments
 (0)