Skip to content

Commit 9d8b430

Browse files
committed
review
1 parent a3d4043 commit 9d8b430

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

.markdownlint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"default": true,
3+
"MD010": { "code_blocks": false },
34
"MD013": { "line_length": "300" },
45
"MD033": false,
56
"MD036": false,

docs/sources/crd.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,37 @@ Here is typical example of [CRD API type](https://github.com/kubernetes-sigs/ext
1515
type TTL int64
1616
type Targets []string
1717
type ProviderSpecificProperty struct {
18-
Name string `json:"name,omitempty"`
19-
Value string `json:"value,omitempty"`
18+
Name string `json:"name,omitempty"`
19+
Value string `json:"value,omitempty"`
2020
}
2121
type ProviderSpecific []ProviderSpecificProperty
2222
type Labels map[string]string
2323

2424
type Endpoint struct {
25-
// The hostname of the DNS record
26-
DNSName string `json:"dnsName,omitempty"`
27-
// The targets the DNS record points to
28-
Targets Targets `json:"targets,omitempty"`
29-
// RecordType type of record, e.g. CNAME, A, SRV, TXT etc
30-
RecordType string `json:"recordType,omitempty"`
31-
// TTL for the record
32-
RecordTTL TTL `json:"recordTTL,omitempty"`
33-
// Labels stores labels defined for the Endpoint
34-
// +optional
35-
Labels Labels `json:"labels,omitempty"`
36-
// ProviderSpecific stores provider specific config
37-
// +optional
38-
ProviderSpecific ProviderSpecific `json:"providerSpecific,omitempty"`
25+
// The hostname of the DNS record
26+
DNSName string `json:"dnsName,omitempty"`
27+
// The targets the DNS record points to
28+
Targets Targets `json:"targets,omitempty"`
29+
// RecordType type of record, e.g. CNAME, A, SRV, TXT etc
30+
RecordType string `json:"recordType,omitempty"`
31+
// TTL for the record
32+
RecordTTL TTL `json:"recordTTL,omitempty"`
33+
// Labels stores labels defined for the Endpoint
34+
// +optional
35+
Labels Labels `json:"labels,omitempty"`
36+
// ProviderSpecific stores provider specific config
37+
// +optional
38+
ProviderSpecific ProviderSpecific `json:"providerSpecific,omitempty"`
3939
}
4040

4141
type DNSEndpointSpec struct {
42-
Endpoints []*Endpoint `json:"endpoints,omitempty"`
42+
Endpoints []*Endpoint `json:"endpoints,omitempty"`
4343
}
4444

4545
type DNSEndpointStatus struct {
46-
// The generation observed by the external-dns controller.
47-
// +optional
48-
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
46+
// The generation observed by the external-dns controller.
47+
// +optional
48+
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
4949
}
5050

5151
// +genclient
@@ -56,13 +56,12 @@ type DNSEndpointStatus struct {
5656
// +kubebuilder:resource:path=dnsendpoints
5757
// +kubebuilder:subresource:status
5858
type DNSEndpoint struct {
59-
metav1.TypeMeta `json:",inline"`
60-
metav1.ObjectMeta `json:"metadata,omitempty"`
59+
metav1.TypeMeta `json:",inline"`
60+
metav1.ObjectMeta `json:"metadata,omitempty"`
6161

62-
Spec DNSEndpointSpec `json:"spec,omitempty"`
63-
Status DNSEndpointStatus `json:"status,omitempty"`
62+
Spec DNSEndpointSpec `json:"spec,omitempty"`
63+
Status DNSEndpointStatus `json:"status,omitempty"`
6464
}
65-
6665
```
6766

6867
Refer to [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) to create and register the CRD.
@@ -99,7 +98,7 @@ dnsendpoint.externaldns.k8s.io "examplednsrecord" created
9998

10099
Run external-dns in dry-mode to see whether external-dns picks up the DNS record from CRD.
101100

102-
```yaml
101+
```sh
103102
$ build/external-dns --source crd --crd-source-apiversion externaldns.k8s.io/v1alpha1 --crd-source-kind DNSEndpoint --provider inmemory --once --dry-run
104103
INFO[0000] running in dry-run mode. No changes to DNS records will be made.
105104
INFO[0000] Connected to cluster at https://192.168.99.100:8443

0 commit comments

Comments
 (0)