Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws): check endpoint for nil before using in aws provider #4626

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mat285
Copy link

@mat285 mat285 commented Jul 19, 2024

Description

Check endpoints for nil to ensure they are valid before use in AWS provider

Fixes #4176

Checklist

  • Unit tests updated
  • End user documentation updated

Copy link

linux-foundation-easycla bot commented Jul 19, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign szuecs for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 19, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @mat285. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 19, 2024
@@ -435,22 +435,26 @@ func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZon
}

ep := endpoint.NewEndpointWithTTL(wildcardUnescape(aws.StringValue(r.Name)), aws.StringValue(r.Type), ttl, targets...)
if aws.StringValue(r.Type) == endpoint.RecordTypeCNAME {
ep = ep.WithProviderSpecific(providerSpecificAlias, "false")
if ep != nil {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a larger issue across all providers, thoughts on a fix to have NewEndpointWithTTL return an error if we can't create the endpoint and then handling that in all providers rather than failing with returning nil

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 19, 2024
@mat285 mat285 changed the title Check endpoint for nil before using in aws provider fix(aws): check endpoint for nil before using in aws provider Jul 19, 2024
@mat285
Copy link
Author

mat285 commented Jul 22, 2024

@johngmyers @mloiseleur @Raffo @szuecs sorry to bother yall but whenever you have time would love some feedback/review on this fix

@mloiseleur
Copy link
Contributor

@mat285 No PR are reviewed or merged without test.

BTW, as the dns hostname is limited to 63 characters, wdyt of returning a SoftError (and so log it) ?

@mat285
Copy link
Author

mat285 commented Aug 9, 2024

@mat285 No PR are reviewed or merged without test.

BTW, as the dns hostname is limited to 63 characters, wdyt of returning a SoftError (and so log it) ?

Thanks for the response, added a test to aws records test. This happens when the dns name has chars outside of the normal ones (I ran into it with a record containing a ~) that get encoded into strings longer than 63 chars. I'm good with returning a softerror and logging instead of just doing a nil check everywhere

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 6, 2024
@mloiseleur
Copy link
Contributor

/ok-to-test
@mat285 Do you think you can rebase this PR ?

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External-dns crashes when trying to add a hostname with more than 63 characters
4 participants