mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-07 01:56:57 +02:00
Merge pull request #2001 from k0da/crd_v1
Switch to controller-gen for CRD generation and update CRD to apiextentions v1
This commit is contained in:
commit
e5fd13044f
22
Makefile
22
Makefile
@ -27,6 +27,23 @@ cover:
|
|||||||
cover-html: cover
|
cover-html: cover
|
||||||
go tool cover -html cover.out
|
go tool cover -html cover.out
|
||||||
|
|
||||||
|
# find or download controller-gen
|
||||||
|
# download controller-gen if necessary
|
||||||
|
controller-gen:
|
||||||
|
ifeq (, $(shell which controller-gen))
|
||||||
|
@{ \
|
||||||
|
set -e ;\
|
||||||
|
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
|
||||||
|
cd $$CONTROLLER_GEN_TMP_DIR ;\
|
||||||
|
go mod init tmp ;\
|
||||||
|
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0 ;\
|
||||||
|
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
|
||||||
|
}
|
||||||
|
CONTROLLER_GEN=$(GOBIN)/controller-gen
|
||||||
|
else
|
||||||
|
CONTROLLER_GEN=$(shell which controller-gen)
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: go-lint
|
.PHONY: go-lint
|
||||||
|
|
||||||
# Run the golangci-lint tool
|
# Run the golangci-lint tool
|
||||||
@ -51,6 +68,11 @@ licensecheck:
|
|||||||
# Run all the linters
|
# Run all the linters
|
||||||
lint: licensecheck go-lint
|
lint: licensecheck go-lint
|
||||||
|
|
||||||
|
.PHONY: crd
|
||||||
|
|
||||||
|
# generates CRD using controller-gen
|
||||||
|
crd: controller-gen
|
||||||
|
${CONTROLLER_GEN} crd:crdVersions=v1 paths="./endpoint/..." output:crd:stdout > docs/contributing/crd-source/crd-manifest.yaml
|
||||||
|
|
||||||
# The verify target runs tasks similar to the CI tasks, but without code coverage
|
# The verify target runs tasks similar to the CI tasks, but without code coverage
|
||||||
.PHONY: verify test
|
.PHONY: verify test
|
||||||
|
@ -1,62 +1,93 @@
|
|||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.5.0
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
labels:
|
|
||||||
api: externaldns
|
|
||||||
kubebuilder.k8s.io: 1.0.0
|
|
||||||
name: dnsendpoints.externaldns.k8s.io
|
name: dnsendpoints.externaldns.k8s.io
|
||||||
spec:
|
spec:
|
||||||
group: externaldns.k8s.io
|
group: externaldns.k8s.io
|
||||||
names:
|
names:
|
||||||
kind: DNSEndpoint
|
kind: DNSEndpoint
|
||||||
|
listKind: DNSEndpointList
|
||||||
plural: dnsendpoints
|
plural: dnsendpoints
|
||||||
|
singular: dnsendpoint
|
||||||
scope: Namespaced
|
scope: Namespaced
|
||||||
subresources:
|
versions:
|
||||||
status: {}
|
- name: v1alpha1
|
||||||
validation:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
type: string
|
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||||
kind:
|
type: string
|
||||||
type: string
|
kind:
|
||||||
metadata:
|
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||||
type: object
|
type: string
|
||||||
spec:
|
metadata:
|
||||||
properties:
|
type: object
|
||||||
endpoints:
|
spec:
|
||||||
items:
|
description: DNSEndpointSpec defines the desired state of DNSEndpoint
|
||||||
properties:
|
properties:
|
||||||
dnsName:
|
endpoints:
|
||||||
type: string
|
items:
|
||||||
labels:
|
description: Endpoint is a high-level way of a connection between a service and an IP
|
||||||
type: object
|
properties:
|
||||||
providerSpecific:
|
dnsName:
|
||||||
items:
|
description: The hostname of the DNS record
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
value:
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
recordTTL:
|
|
||||||
format: int64
|
|
||||||
type: integer
|
|
||||||
recordType:
|
|
||||||
type: string
|
|
||||||
targets:
|
|
||||||
items:
|
|
||||||
type: string
|
type: string
|
||||||
type: array
|
labels:
|
||||||
type: object
|
additionalProperties:
|
||||||
type: array
|
type: string
|
||||||
type: object
|
description: Labels stores labels defined for the Endpoint
|
||||||
status:
|
type: object
|
||||||
properties:
|
providerSpecific:
|
||||||
observedGeneration:
|
description: ProviderSpecific stores provider specific config
|
||||||
format: int64
|
items:
|
||||||
type: integer
|
description: ProviderSpecificProperty holds the name and value of a configuration which is specific to individual DNS providers
|
||||||
type: object
|
properties:
|
||||||
version: v1alpha1
|
name:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
recordTTL:
|
||||||
|
description: TTL for the record
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
recordType:
|
||||||
|
description: RecordType type of record, e.g. CNAME, A, SRV, TXT etc
|
||||||
|
type: string
|
||||||
|
setIdentifier:
|
||||||
|
description: Identifier to distinguish multiple records with the same name and type (e.g. Route53 records with routing policies other than 'simple')
|
||||||
|
type: string
|
||||||
|
targets:
|
||||||
|
description: The targets the DNS record points to
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
status:
|
||||||
|
description: DNSEndpointStatus defines the observed state of DNSEndpoint
|
||||||
|
properties:
|
||||||
|
observedGeneration:
|
||||||
|
description: The generation observed by the external-dns controller.
|
||||||
|
format: int64
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
status:
|
||||||
|
acceptedNames:
|
||||||
|
kind: ""
|
||||||
|
plural: ""
|
||||||
|
conditions: []
|
||||||
|
storedVersions: []
|
||||||
|
@ -213,8 +213,12 @@ type DNSEndpointStatus struct {
|
|||||||
// DNSEndpoint is a contract that a user-specified CRD must implement to be used as a source for external-dns.
|
// DNSEndpoint is a contract that a user-specified CRD must implement to be used as a source for external-dns.
|
||||||
// The user-specified CRD should also have the status sub-resource.
|
// The user-specified CRD should also have the status sub-resource.
|
||||||
// +k8s:openapi-gen=true
|
// +k8s:openapi-gen=true
|
||||||
|
// +groupName=externaldns.k8s.io
|
||||||
// +kubebuilder:resource:path=dnsendpoints
|
// +kubebuilder:resource:path=dnsendpoints
|
||||||
|
// +kubebuilder:object:root=true
|
||||||
// +kubebuilder:subresource:status
|
// +kubebuilder:subresource:status
|
||||||
|
// +versionName=v1alpha1
|
||||||
|
|
||||||
type DNSEndpoint struct {
|
type DNSEndpoint struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||||
@ -223,6 +227,7 @@ type DNSEndpoint struct {
|
|||||||
Status DNSEndpointStatus `json:"status,omitempty"`
|
Status DNSEndpointStatus `json:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// +kubebuilder:object:root=true
|
||||||
// DNSEndpointList is a list of DNSEndpoint objects
|
// DNSEndpointList is a list of DNSEndpoint objects
|
||||||
type DNSEndpointList struct {
|
type DNSEndpointList struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
Loading…
Reference in New Issue
Block a user