Skip to content

Commit

Permalink
add an excludeAddresses option in DNSPolicy
Browse files Browse the repository at this point in the history
Signed-off-by: craig <[email protected]>

rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED

add integration test for excludeAddresses

updates post rebase

add total records to status. Add additional status message info

fix-integration

update status and tests

add doc

update dnspolicy ref
  • Loading branch information
maleck13 committed Oct 4, 2024
1 parent d838ca2 commit 22fae06
Show file tree
Hide file tree
Showing 16 changed files with 1,305 additions and 693 deletions.
15 changes: 15 additions & 0 deletions api/v1alpha1/dnspolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ type DNSPolicySpec struct {
// +kubebuilder:validation:MaxItems=1
// +kubebuilder:validation:MinItems=1
ProviderRefs []dnsv1alpha1.ProviderRef `json:"providerRefs"`

// ExcludeAddresses is a list of addresses (either hostnames, CIDR or IPAddresses) that DNSPolicy should not use as values in the configured DNS provider records. The default is to allow all addresses configured in the Gateway DNSPolicy is targeting
// +optional
// +kubebuilder:validation:MaxItems=20
ExcludeAddresses []string `json:"excludeAddresses,omitempty"`
}

type LoadBalancingSpec struct {
Expand Down Expand Up @@ -125,6 +130,9 @@ type DNSPolicyStatus struct {

// +optional
RecordConditions map[string][]metav1.Condition `json:"recordConditions,omitempty"`
// TotalRecords records the total number of individual DNSRecords managed by this DNSPolicy
// +optional
TotalRecords int32 `json:"totalRecords,omitempty"`
}

func (s *DNSPolicyStatus) GetConditions() []metav1.Condition {
Expand Down Expand Up @@ -251,6 +259,13 @@ func (p *DNSPolicy) WithProviderSecret(s corev1.Secret) *DNSPolicy {
})
}

//excludeAddresses

func (p *DNSPolicy) WithExcludeAddresses(excluded []string) *DNSPolicy {
p.Spec.ExcludeAddresses = excluded
return p

Check warning on line 266 in api/v1alpha1/dnspolicy_types.go

View check run for this annotation

Codecov / codecov/patch

api/v1alpha1/dnspolicy_types.go#L264-L266

Added lines #L264 - L266 were not covered by tests
}

//TargetRef

func (p *DNSPolicy) WithTargetGateway(gwName string) *DNSPolicy {
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 22fae06

Please sign in to comment.