Skip to content

Commit 7931d8d

Browse files
authored
Merge branch 'kubernetes-sigs:master' into master
2 parents 285d976 + 521114a commit 7931d8d

File tree

21 files changed

+1369
-773
lines changed

21 files changed

+1369
-773
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ formatters:
9595
exclusions:
9696
generated: lax
9797
paths:
98-
- endpoint/zz_generated.deepcopy.go
9998
- third_party$
10099
- builtin$
101100
- examples$

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ lint: licensecheck go-lint oas-lint
6666
#? crd: Generates CRD using controller-gen and copy it into chart
6767
.PHONY: crd
6868
crd: controller-gen-install
69-
${CONTROLLER_GEN} crd:crdVersions=v1 paths="./endpoint/..." output:crd:stdout > config/crd/standard/dnsendpoint.yaml
69+
${CONTROLLER_GEN} object crd:crdVersions=v1 paths="./endpoint/..."
70+
${CONTROLLER_GEN} object crd:crdVersions=v1 paths="./apis/..." output:crd:stdout > config/crd/standard/dnsendpoint.yaml
7071
cp -f config/crd/standard/dnsendpoint.yaml charts/external-dns/crds/dnsendpoint.yaml
7172

7273
#? test: The verify target runs tasks similar to the CI tasks, but without code coverage

apis/api.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package apis

apis/v1alpha1/api.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
Copyright 2017 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1alpha1 contains API Schema definitions for the externaldns.k8s.io v1alpha1 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=externaldns.k8s.io
20+
package v1alpha1

apis/v1alpha1/dnsendpoint.go

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
Copyright 2017 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
22+
"sigs.k8s.io/external-dns/endpoint"
23+
)
24+
25+
// +genclient
26+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
27+
28+
// DNSEndpoint is a contract that a user-specified CRD must implement to be used as a source for external-dns.
29+
// The user-specified CRD should also have the status sub-resource.
30+
// +k8s:openapi-gen=true
31+
// +groupName=externaldns.k8s.io
32+
// +kubebuilder:resource:path=dnsendpoints
33+
// +kubebuilder:subresource:status
34+
// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes-sigs/external-dns/pull/2007"
35+
// +versionName=v1alpha1
36+
type DNSEndpoint struct {
37+
metav1.TypeMeta `json:",inline"`
38+
metav1.ObjectMeta `json:"metadata,omitempty"`
39+
40+
Spec DNSEndpointSpec `json:"spec,omitempty"`
41+
Status DNSEndpointStatus `json:"status,omitempty"`
42+
}
43+
44+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
45+
// DNSEndpointList is a list of DNSEndpoint objects
46+
type DNSEndpointList struct {
47+
metav1.TypeMeta `json:",inline"`
48+
metav1.ListMeta `json:"metadata,omitempty"`
49+
Items []DNSEndpoint `json:"items"`
50+
}
51+
52+
// DNSEndpointSpec defines the desired state of DNSEndpoint
53+
type DNSEndpointSpec struct {
54+
Endpoints []*endpoint.Endpoint `json:"endpoints,omitempty"`
55+
}
56+
57+
// DNSEndpointStatus defines the observed state of DNSEndpoint
58+
type DNSEndpointStatus struct {
59+
// The generation observed by the external-dns controller.
60+
// +optional
61+
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
62+
}

apis/v1alpha1/groupversion_info.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
Copyright 2017 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1alpha1 contains API Schema definitions for the externaldns.k8s.io v1alpha1 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=externaldns.k8s.io
20+
package v1alpha1
21+
22+
import (
23+
"k8s.io/apimachinery/pkg/runtime/schema"
24+
"sigs.k8s.io/controller-runtime/pkg/scheme"
25+
)
26+
27+
var (
28+
// GroupVersion is group version used to register these objects
29+
GroupVersion = schema.GroupVersion{Group: "externaldns.k8s.io", Version: "v1alpha1"}
30+
31+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
32+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
33+
34+
// AddToScheme adds the types in this group-version to the given scheme.
35+
AddToScheme = SchemeBuilder.AddToScheme
36+
)
37+
38+
func init() {
39+
SchemeBuilder.Register(&DNSEndpoint{}, &DNSEndpointList{})
40+
}

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/external-dns/crds/dnsendpoint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ spec:
1818
- name: v1alpha1
1919
schema:
2020
openAPIV3Schema:
21+
description: |-
22+
DNSEndpoint is a contract that a user-specified CRD must implement to be used as a source for external-dns.
23+
The user-specified CRD should also have the status sub-resource.
2124
properties:
2225
apiVersion:
2326
description: |-

config/crd/standard/dnsendpoint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ spec:
1818
- name: v1alpha1
1919
schema:
2020
openAPIV3Schema:
21+
description: |-
22+
DNSEndpoint is a contract that a user-specified CRD must implement to be used as a source for external-dns.
23+
The user-specified CRD should also have the status sub-resource.
2124
properties:
2225
apiVersion:
2326
description: |-

endpoint/endpoint.go

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import (
2424
"strings"
2525

2626
log "github.com/sirupsen/logrus"
27-
28-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2927
)
3028

3129
const (
@@ -337,48 +335,6 @@ func FilterEndpointsByOwnerID(ownerID string, eps []*Endpoint) []*Endpoint {
337335
return filtered
338336
}
339337

340-
// DNSEndpointSpec defines the desired state of DNSEndpoint
341-
// +kubebuilder:object:generate=true
342-
type DNSEndpointSpec struct {
343-
Endpoints []*Endpoint `json:"endpoints,omitempty"`
344-
}
345-
346-
// DNSEndpointStatus defines the observed state of DNSEndpoint
347-
type DNSEndpointStatus struct {
348-
// The generation observed by the external-dns controller.
349-
// +optional
350-
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
351-
}
352-
353-
// +genclient
354-
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
355-
356-
// DNSEndpoint is a contract that a user-specified CRD must implement to be used as a source for external-dns.
357-
// The user-specified CRD should also have the status sub-resource.
358-
// +k8s:openapi-gen=true
359-
// +groupName=externaldns.k8s.io
360-
// +kubebuilder:resource:path=dnsendpoints
361-
// +kubebuilder:object:root=true
362-
// +kubebuilder:subresource:status
363-
// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes-sigs/external-dns/pull/2007"
364-
// +versionName=v1alpha1
365-
366-
type DNSEndpoint struct {
367-
metav1.TypeMeta `json:",inline"`
368-
metav1.ObjectMeta `json:"metadata,omitempty"`
369-
370-
Spec DNSEndpointSpec `json:"spec,omitempty"`
371-
Status DNSEndpointStatus `json:"status,omitempty"`
372-
}
373-
374-
// +kubebuilder:object:root=true
375-
// DNSEndpointList is a list of DNSEndpoint objects
376-
type DNSEndpointList struct {
377-
metav1.TypeMeta `json:",inline"`
378-
metav1.ListMeta `json:"metadata,omitempty"`
379-
Items []DNSEndpoint `json:"items"`
380-
}
381-
382338
// RemoveDuplicates returns a slice holding the unique endpoints.
383339
// This function doesn't contemplate the Targets of an Endpoint
384340
// as part of the primary Key
@@ -400,7 +356,7 @@ func RemoveDuplicates(endpoints []*Endpoint) []*Endpoint {
400356
return result
401357
}
402358

403-
// Check endpoint if is it properly formatted according to RFC standards
359+
// CheckEndpoint Check if endpoint is properly formatted according to RFC standards
404360
func (e *Endpoint) CheckEndpoint() bool {
405361
switch recordType := e.RecordType; recordType {
406362
case RecordTypeMX:

0 commit comments

Comments
 (0)