Skip to content

Commit a14eb1b

Browse files
authored
Merge pull request #3 from kvaps/upd-controller-gen
Update controller-gen
2 parents 7dd2859 + a394761 commit a14eb1b

File tree

6 files changed

+278
-304
lines changed

6 files changed

+278
-304
lines changed

Makefile

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
# Image URL to use all building/pushing image targets
33
IMG ?= docker.io/kvaps/dnsmasq-controller:latest
4-
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
5-
CRD_OPTIONS ?= "crd:trivialVersions=true"
64

75
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
86
ifeq (,$(shell go env GOBIN))
@@ -11,6 +9,8 @@ else
119
GOBIN=$(shell go env GOBIN)
1210
endif
1311

12+
CONTROLLER_GEN = go run sigs.k8s.io/controller-tools/cmd/[email protected]
13+
1414
all: manager
1515

1616
# Run tests
@@ -48,8 +48,8 @@ deploy: manifests
4848
kubectl apply -n default -f config/controller/dhcp-server.yaml
4949

5050
# Generate manifests e.g. CRD, RBAC etc.
51-
manifests: controller-gen
52-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=dnsmasq-controller paths="./..." output:crd:artifacts:config=config/crd/bases
51+
manifests:
52+
$(CONTROLLER_GEN) crd rbac:roleName=dnsmasq-controller paths="./..." output:crd:artifacts:config=config/crd/bases
5353

5454
# Run go fmt against code
5555
fmt:
@@ -60,7 +60,7 @@ vet:
6060
go vet ./...
6161

6262
# Generate code
63-
generate: controller-gen
63+
generate:
6464
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
6565

6666
# Build the docker image
@@ -70,20 +70,3 @@ docker-build: test
7070
# Push the docker image
7171
docker-push:
7272
docker push ${IMG}
73-
74-
# find or download controller-gen
75-
# download controller-gen if necessary
76-
controller-gen:
77-
ifeq (, $(shell which controller-gen))
78-
@{ \
79-
set -e ;\
80-
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
81-
cd $$CONTROLLER_GEN_TMP_DIR ;\
82-
go mod init tmp ;\
83-
go get sigs.k8s.io/controller-tools/cmd/[email protected] ;\
84-
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
85-
}
86-
CONTROLLER_GEN=$(GOBIN)/controller-gen
87-
else
88-
CONTROLLER_GEN=$(shell which controller-gen)
89-
endif

config/crd/bases/dnsmasq.kvaps.cf_dhcphosts.yaml

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,86 @@
1-
21
---
3-
apiVersion: apiextensions.k8s.io/v1beta1
2+
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.2.5
6+
controller-gen.kubebuilder.io/version: v0.8.0
87
creationTimestamp: null
98
name: dhcphosts.dnsmasq.kvaps.cf
109
spec:
11-
additionalPrinterColumns:
12-
- JSONPath: .spec.controller
13-
name: Controller
14-
type: string
15-
- JSONPath: .metadata.creationTimestamp
16-
name: Age
17-
type: date
1810
group: dnsmasq.kvaps.cf
1911
names:
2012
kind: DhcpHosts
2113
listKind: DhcpHostsList
2214
plural: dhcphosts
2315
singular: dhcphosts
2416
scope: Namespaced
25-
subresources: {}
26-
validation:
27-
openAPIV3Schema:
28-
description: DhcpHosts is the Schema for the dhcphosts API
29-
properties:
30-
apiVersion:
31-
description: 'APIVersion defines the versioned schema of this representation
32-
of an object. Servers should convert recognized schemas to the latest
33-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
34-
type: string
35-
kind:
36-
description: 'Kind is a string value representing the REST resource this
37-
object represents. Servers may infer this from the endpoint the client
38-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
39-
type: string
40-
metadata:
41-
type: object
42-
spec:
43-
description: DhcpHostsSpec defines the desired state of DhcpHosts
44-
properties:
45-
controller:
46-
type: string
47-
hosts:
48-
items:
49-
description: DnsmasqDhcpHost holds the mapping between Macs and IP
50-
that will be added to dnsmasq dhcp-hosts file.
51-
properties:
52-
clientID:
53-
type: string
54-
hostname:
55-
type: string
56-
ignore:
57-
type: boolean
58-
ip:
59-
type: string
60-
leaseTime:
61-
type: string
62-
macs:
63-
items:
17+
versions:
18+
- additionalPrinterColumns:
19+
- jsonPath: .spec.controller
20+
name: Controller
21+
type: string
22+
- jsonPath: .metadata.creationTimestamp
23+
name: Age
24+
type: date
25+
name: v1beta1
26+
schema:
27+
openAPIV3Schema:
28+
description: DhcpHosts is the Schema for the dhcphosts API
29+
properties:
30+
apiVersion:
31+
description: 'APIVersion defines the versioned schema of this representation
32+
of an object. Servers should convert recognized schemas to the latest
33+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
34+
type: string
35+
kind:
36+
description: 'Kind is a string value representing the REST resource this
37+
object represents. Servers may infer this from the endpoint the client
38+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
39+
type: string
40+
metadata:
41+
type: object
42+
spec:
43+
description: DhcpHostsSpec defines the desired state of DhcpHosts
44+
properties:
45+
controller:
46+
type: string
47+
hosts:
48+
items:
49+
description: DnsmasqDhcpHost holds the mapping between Macs and
50+
IP that will be added to dnsmasq dhcp-hosts file.
51+
properties:
52+
clientID:
6453
type: string
65-
type: array
66-
setTags:
67-
items:
54+
hostname:
6855
type: string
69-
type: array
70-
tags:
71-
items:
56+
ignore:
57+
type: boolean
58+
ip:
7259
type: string
73-
type: array
74-
type: object
75-
type: array
76-
type: object
77-
status:
78-
description: DhcpHostsStatus defines the observed state of DhcpHosts
79-
type: object
80-
type: object
81-
version: v1beta1
82-
versions:
83-
- name: v1beta1
60+
leaseTime:
61+
type: string
62+
macs:
63+
items:
64+
type: string
65+
type: array
66+
setTags:
67+
items:
68+
type: string
69+
type: array
70+
tags:
71+
items:
72+
type: string
73+
type: array
74+
type: object
75+
type: array
76+
type: object
77+
status:
78+
description: DhcpHostsStatus defines the observed state of DhcpHosts
79+
type: object
80+
type: object
8481
served: true
8582
storage: true
83+
subresources: {}
8684
status:
8785
acceptedNames:
8886
kind: ""

config/crd/bases/dnsmasq.kvaps.cf_dhcpoptions.yaml

Lines changed: 62 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,83 @@
1-
21
---
3-
apiVersion: apiextensions.k8s.io/v1beta1
2+
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.2.5
6+
controller-gen.kubebuilder.io/version: v0.8.0
87
creationTimestamp: null
98
name: dhcpoptions.dnsmasq.kvaps.cf
109
spec:
11-
additionalPrinterColumns:
12-
- JSONPath: .spec.controller
13-
name: Controller
14-
type: string
15-
- JSONPath: .metadata.creationTimestamp
16-
name: Age
17-
type: date
1810
group: dnsmasq.kvaps.cf
1911
names:
2012
kind: DhcpOptions
2113
listKind: DhcpOptionsList
2214
plural: dhcpoptions
2315
singular: dhcpoptions
2416
scope: Namespaced
25-
subresources: {}
26-
validation:
27-
openAPIV3Schema:
28-
description: DhcpOptions is the Schema for the dhcpoptions API
29-
properties:
30-
apiVersion:
31-
description: 'APIVersion defines the versioned schema of this representation
32-
of an object. Servers should convert recognized schemas to the latest
33-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
34-
type: string
35-
kind:
36-
description: 'Kind is a string value representing the REST resource this
37-
object represents. Servers may infer this from the endpoint the client
38-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
39-
type: string
40-
metadata:
41-
type: object
42-
spec:
43-
description: DhcpOptionsSpec defines the desired state of DhcpOptions
44-
properties:
45-
controller:
46-
type: string
47-
options:
48-
items:
49-
description: DhcpOption defines dhcp-option for dnsmasq
50-
properties:
51-
encap:
52-
type: string
53-
key:
54-
pattern: ^([0-9]+|option:.+|option6:.+)$
55-
type: string
56-
leaseTime:
57-
type: string
58-
tags:
59-
items:
17+
versions:
18+
- additionalPrinterColumns:
19+
- jsonPath: .spec.controller
20+
name: Controller
21+
type: string
22+
- jsonPath: .metadata.creationTimestamp
23+
name: Age
24+
type: date
25+
name: v1beta1
26+
schema:
27+
openAPIV3Schema:
28+
description: DhcpOptions is the Schema for the dhcpoptions API
29+
properties:
30+
apiVersion:
31+
description: 'APIVersion defines the versioned schema of this representation
32+
of an object. Servers should convert recognized schemas to the latest
33+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
34+
type: string
35+
kind:
36+
description: 'Kind is a string value representing the REST resource this
37+
object represents. Servers may infer this from the endpoint the client
38+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
39+
type: string
40+
metadata:
41+
type: object
42+
spec:
43+
description: DhcpOptionsSpec defines the desired state of DhcpOptions
44+
properties:
45+
controller:
46+
type: string
47+
options:
48+
items:
49+
description: DhcpOption defines dhcp-option for dnsmasq
50+
properties:
51+
encap:
6052
type: string
61-
type: array
62-
values:
63-
items:
53+
key:
54+
pattern: ^([0-9]+|option:.+|option6:.+)$
6455
type: string
65-
type: array
66-
viEncap:
67-
type: string
68-
required:
69-
- key
70-
- values
71-
type: object
72-
type: array
73-
type: object
74-
status:
75-
description: DhcpOptionsStatus defines the observed state of DhcpOptions
76-
type: object
77-
type: object
78-
version: v1beta1
79-
versions:
80-
- name: v1beta1
56+
leaseTime:
57+
type: string
58+
tags:
59+
items:
60+
type: string
61+
type: array
62+
values:
63+
items:
64+
type: string
65+
type: array
66+
viEncap:
67+
type: string
68+
required:
69+
- key
70+
- values
71+
type: object
72+
type: array
73+
type: object
74+
status:
75+
description: DhcpOptionsStatus defines the observed state of DhcpOptions
76+
type: object
77+
type: object
8178
served: true
8279
storage: true
80+
subresources: {}
8381
status:
8482
acceptedNames:
8583
kind: ""

0 commit comments

Comments
 (0)