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

Allow specification of targets in VirtualServer's spec.externalDNS field #7009

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

j1m-ryan
Copy link
Member

Proposed changes

Implements #5196

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@j1m-ryan j1m-ryan requested review from a team as code owners December 17, 2024 16:52
@github-actions github-actions bot added enhancement Pull requests for new features/feature enhancements documentation Pull requests/issues for documentation go Pull requests that update Go code labels Dec 17, 2024
Copy link

Deploy Preview will be available once build job completes!

Name Link
😎 Deploy Preview https://frontdoor-test-docs.nginx.com/previews/nginx-ingress-controller/7009/

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 81.11111% with 17 lines in your changes missing coverage. Please review.

Project coverage is 52.77%. Comparing base (6103b0a) to head (310db1a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/externaldns/sync.go 65.71% 8 Missing and 4 partials ⚠️
pkg/apis/configuration/validation/virtualserver.go 37.50% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7009      +/-   ##
==========================================
+ Coverage   52.73%   52.77%   +0.04%     
==========================================
  Files          89       89              
  Lines       20824    20873      +49     
==========================================
+ Hits        10981    11016      +35     
- Misses       9389     9399      +10     
- Partials      454      458       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

if count > 1 {
return nil, "", errors.New("multiple record types (A, AAAA, CNAME) detected; must be homogeneous")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having both A & AAAA records is a valid use case

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a valid point. However, given that the VirtualServer.spec.externalDNS object includes a recordType field, indicating that each DNS entry must be homogeneous, it’s reasonable to expect this limitation to a single record type.

var recordA, recordAAAA, recordCNAME bool

for _, t := range targets {
if errMsg := validation.IsValidIP(field.NewPath(""), t); len(errMsg) == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

IsValidIP is a wrapper for netutils.ParseIPSloppy(), there is probably no need to call it twice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements go Pull requests that update Go code
Projects
Status: Todo ☑
Development

Successfully merging this pull request may close these issues.

2 participants