Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Dns refactor #780

Merged
merged 3 commits into from
Feb 1, 2024
Merged

Dns refactor #780

merged 3 commits into from
Feb 1, 2024

Conversation

mikenairn
Copy link
Member

@mikenairn mikenairn commented Feb 1, 2024

Number of changes required(mostly) to isolate the dns code from the policy and gateway logic in preparation for moving it to it's own repo.

Provider health checks were removed from the aws dns provider implementation. These have been replaced by provider agnostic health checks and are no longer a supported solution.

DNS provider implementations are moved into a provider package(dns/provider) along with all other dns provider related interfaces and types. Matches external-dns layout and naming and how we want future providers to be added.

Updates the dns provider factory to have each provider register its constructor with the factory on init. Adds fake provider and factory for testing and updates field names in reconcilers to better represent what the Factory resource is (DNSProvider -> ProviderFactory). Factory method (ProviderFor) now expects a resource implementing the ProviderAccessor interface.
Note: These changes were based on how certmanager implements registration and a factory for Issuers and seemed like a nice solution. Also gets round some import cycle issues i was having with the refactor.

Move common dns consts and types into api (DefaultWeight, DefaultGeo, WildcardGeo, GeoCode ), remove redundant code from DNSRecord and make receiver name consistent. Added common pkg for consistency with kuadrant-operator and moved target and gateway wrapper resources into here.

Move health package into dns/health. The contents of the dns package will all be moved to the new dns controller component as top level packages:

.                                   
├── controller                                         
└── pkg                                           
    ├── health                                                      
    └── provider                                        
        ├── aws                                
        ├── fake                                           
        └── google

Number of changes required(mostly) to isolate the dns code from the
policy and gateway logic in preparation for moving it to it's own repo.

Provider health checks were removed from the aws dns provider
implementation. These have been replaced by provder agnostic health
checks and are no longer a supported solution.

DNS provider implementations are moved into a provider package
(dns/provider) along with all other dns provider related interfaces and
types. Matches external-dns layout and naming and how we want future
providers to be added.

Updates the dns provider factory to have each provider register its
constructor with the factory on init.  Adds fake provider and factory
for testing and updates field names in reconcilers to better represent
what the Factory resource is (DNSProvider -> ProviderFactory). Factory
method (ProviderFor) now expects a resource implementing the
ProviderAccessor interface.

Move common dns consts and types into api (DefaultWeight, DefaultGeo,
WildcardGeo, GeoCode ), remove redundant code from DNSRecord and make
receiver name consistent.
Added common pkg for consistency with kuadrant-operator and moved target
and gateway wrapper resources into here.
Removes the dnspolicy demo docs as they are always becoming out of date
and as long as its here it feels like it needs to be kept up to date.
The contents of the dns package will all be moved to the new dns controller component as top level packages:

```
.
├── controller
└── pkg
    ├── health
    └── provider
        ├── aws
        ├── fake
        └── google
```
Copy link
Contributor

@maleck13 maleck13 left a comment

Choose a reason for hiding this comment

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

Changes all look reasonable and make sense

@maleck13
Copy link
Contributor

maleck13 commented Feb 1, 2024

/lgtm

Copy link
Contributor

openshift-ci bot commented Feb 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maleck13, mikenairn

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

@openshift-ci openshift-ci bot added the lgtm label Feb 1, 2024
@maleck13 maleck13 added this pull request to the merge queue Feb 1, 2024
Merged via the queue into Kuadrant:main with commit d2e05a0 Feb 1, 2024
10 checks passed
@mikenairn mikenairn deleted the dns_refactor branch February 1, 2024 11:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants