@@ -23,20 +23,61 @@ help: ## Display this help.
23
23
24
24
# #@ Development
25
25
26
+ CLIENTSET_NAME ?= versioned
27
+ CLIENTSET_PKG_NAME ?= clientset
28
+ API_PKG ?= sigs.k8s.io/network-policy-api
29
+ API_GROUP_NAME ?= policy.networking.k8s.io
30
+ API_DIR ?= ${API_PKG}/apis/v1alpha1
31
+ OUTPUT_PKG ?= sigs.k8s.io/network-policy-api/client
32
+ COMMON_FLAGS ?= --go-header-file $(shell pwd) /hack/boilerplate.go.txt
33
+
34
+ .PHONY : manifests
26
35
manifests : # # Generate ClusterRole and CustomResourceDefinition objects.
27
36
go run sigs.k8s.io/controller-tools/cmd/controller-gen rbac:roleName=manager-role crd paths=./apis/... output:crd:dir=./config/crd/bases output:stdout
28
37
29
- generate : # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
30
- go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
31
-
38
+ .PHONY : fmt
32
39
fmt : # # Run go fmt against code.
33
40
go fmt ./...
34
41
42
+ .PHONY : vet
35
43
vet : # # Run go vet against code.
36
44
go vet ./...
37
45
46
+ .PHONY : generate
47
+ generate : generate-deepcopy generate-typed-clients generate-typed-listers generate-typed-informers
48
+
49
+ .PHONY : generate-deepcopy
50
+ generate-deepcopy : # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
51
+ go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
52
+
53
+ .PHONY : generate-typed-clients
54
+ generate-typed-clients : # # Generate typed client code
55
+ go run k8s.io/code-generator/cmd/client-gen \
56
+ --clientset-name " ${CLIENTSET_NAME} " \
57
+ --input-base " " \
58
+ --input " ${API_DIR} " \
59
+ --output-package " ${OUTPUT_PKG} /${CLIENTSET_PKG_NAME} " \
60
+ ${COMMON_FLAGS}
61
+
62
+ .PHONY : generate-typed-listers
63
+ generate-typed-listers : # # Generate typed listers code
64
+ go run k8s.io/code-generator/cmd/lister-gen \
65
+ --input-dirs " ${API_DIR} " \
66
+ --output-package " ${OUTPUT_PKG} /listers" \
67
+ ${COMMON_FLAGS}
68
+
69
+ .PHONY : generate-typed-informers
70
+ generate-typed-informers : # # Generate typed informers code
71
+ go run k8s.io/code-generator/cmd/informer-gen \
72
+ --input-dirs " ${API_DIR} " \
73
+ --versioned-clientset-package " ${OUTPUT_PKG} /${CLIENTSET_PKG_NAME} /${CLIENTSET_NAME} " \
74
+ --listers-package " ${OUTPUT_PKG} /listers" \
75
+ --output-package " ${OUTPUT_PKG} /informers" \
76
+ ${COMMON_FLAGS}
77
+
38
78
all : generate manifests fmt vet # # Runs all the development targets
39
79
80
+ .PHONY : verify
40
81
verify :
41
82
hack/verify-all.sh -v
42
83
0 commit comments