Skip to content

Commit

Permalink
feat(rrset)!: Accept wildcard and SRV records (#35)
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony TREUILLIER <[email protected]>
  • Loading branch information
antrema authored Oct 28, 2024
1 parent 9fd1e4f commit 3d04881
Show file tree
Hide file tree
Showing 20 changed files with 999 additions and 112 deletions.
10 changes: 9 additions & 1 deletion api/v1alpha1/rrset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import (
type RRsetSpec struct {
// Type of the record (e.g. "A", "PTR", "MX").
Type string `json:"type"`
// Name of the record
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Name string `json:"name"`
// DNS TTL of the records, in seconds.
TTL uint32 `json:"ttl"`
// All records in this Resource Record Set.
Expand All @@ -36,15 +39,20 @@ type ZoneRef struct {

// RRsetStatus defines the observed state of RRset
type RRsetStatus struct {
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
DnsEntryName *string `json:"dnsEntryName,omitempty"`
SyncStatus *string `json:"syncStatus,omitempty"`
SyncErrorDescription *string `json:"syncErrorDescription,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// +kubebuilder:printcolumn:name="Zone",type="string",JSONPath=".spec.zoneRef.name"
// +kubebuilder:printcolumn:name="Name",type="string",JSONPath=".status.dnsEntryName"
// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type"
// +kubebuilder:printcolumn:name="TTL",type="integer",JSONPath=".spec.ttl"
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.syncStatus"
// +kubebuilder:printcolumn:name="Records",type="string",JSONPath=".spec.records"
// RRset is the Schema for the rrsets API
type RRset struct {
Expand Down
15 changes: 15 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.

2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func main() {
flag.StringVar(&apiKey, "pdns-api-key", apiKey, "The API key to authenticate with the PowerDNS API")
flag.StringVar(&apiVhost, "pdns-api-vhost", apiVhost, "The vhost of the PowerDNS API")
opts := zap.Options{
Development: true,
Development: false,
}
opts.BindFlags(flag.CommandLine)
flag.Parse()
Expand Down
19 changes: 19 additions & 0 deletions config/crd/bases/dns.cav.enablers.ob_rrsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ spec:
- jsonPath: .spec.zoneRef.name
name: Zone
type: string
- jsonPath: .status.dnsEntryName
name: Name
type: string
- jsonPath: .spec.type
name: Type
type: string
- jsonPath: .spec.ttl
name: TTL
type: integer
- jsonPath: .status.syncStatus
name: Status
type: string
- jsonPath: .spec.records
name: Records
type: string
Expand Down Expand Up @@ -55,6 +61,12 @@ spec:
comment:
description: Comment on RRSet.
type: string
name:
description: Name of the record
type: string
x-kubernetes-validations:
- message: Value is immutable
rule: self == oldSelf
records:
description: All records in this Resource Record Set.
items:
Expand All @@ -77,6 +89,7 @@ spec:
- name
type: object
required:
- name
- records
- ttl
- type
Expand All @@ -85,9 +98,15 @@ spec:
status:
description: RRsetStatus defines the observed state of RRset
properties:
dnsEntryName:
type: string
lastUpdateTime:
format: date-time
type: string
syncErrorDescription:
type: string
syncStatus:
type: string
type: object
type: object
served: true
Expand Down
Loading

0 comments on commit 3d04881

Please sign in to comment.