ec2-controller icon indicating copy to clipboard operation
ec2-controller copied to clipboard

Fix VPC optional DNS attribute handling

Open gfrey opened this issue 1 year ago • 5 comments

Issue #: aws-controllers-k8s/community#1826

Description of changes: Only sync optional fields, if actually configured. More details are in the commit message.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

gfrey avatar Sep 27 '24 11:09 gfrey

Hi @gfrey. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

ack-prow[bot] avatar Sep 27 '24 11:09 ack-prow[bot]

I'm wondering whether this should be accompanied by other changes:

  1. The tests by default set the attributes. This would cover up any regression, when they are required to be set (as they are right now).
  2. Documentation should maybe highlight these values have defaults. If so, I would need some guidance on how to best do those changes.

gfrey avatar Sep 27 '24 11:09 gfrey

/ok-to-test

a-hilaly avatar Sep 27 '24 17:09 a-hilaly

@gfrey: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ec2-verify-attribution 3ebf6f911692ff11a8361bf6239ab67b8fc3652a link false /test ec2-verify-attribution

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

ack-prow[bot] avatar Sep 27 '24 17:09 ack-prow[bot]

Thanks @gfrey ! This looks good to me! QQ: what's the behaviour you're trying to eliminate here? i think the idea was to let people remove the DNS attributes by deleting the field.

a-hilaly avatar Sep 30 '24 17:09 a-hilaly

Thanks @gfrey ! This looks good to me! QQ: what's the behaviour you're trying to eliminate here? i think the idea was to let people remove the DNS attributes by deleting the field.

@a-hilaly I was trying to create a minimal setup. From the documentation the only required field was the CIDR block, but it was failing because of this. Also the linked issue made me believe this is not the wanted behavior.

gfrey avatar Sep 30 '24 17:09 gfrey

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, gfrey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ack-prow[bot] avatar Sep 30 '24 17:09 ack-prow[bot]

@gfrey i have second thoughts on this. While it indeed gonna work. There is still a tiny problem: the controller will still detect a delta on those two fields, ideally what we can do to even avoid getting a delta is, having a customprecompare function, that takes into consideration default fields. For example we can do something similar to https://github.com/aws-controllers-k8s/efs-controller/blob/main/pkg/resource/file_system/hooks.go#L310-L318

a-hilaly avatar Sep 30 '24 18:09 a-hilaly

@gfrey i have second thoughts on this. While it indeed gonna work. There is still a tiny problem: the controller will still detect a delta on those two fields, ideally what we can do to even avoid getting a delta is, having a customprecompare function, that takes into consideration default fields. For example we can do something similar to https://github.com/aws-controllers-k8s/efs-controller/blob/main/pkg/resource/file_system/hooks.go#L310-L318

@a-hilaly Thanks for the pointer, will take a look tomorrow and prepare a second PR.

gfrey avatar Sep 30 '24 19:09 gfrey

Thank you Gereon!! :)

a-hilaly avatar Sep 30 '24 19:09 a-hilaly