|
46 | 46 | # This runs all necessary steps to prepare for a commit. |
47 | 47 | .PHONY: precommit |
48 | 48 | precommit: ## Run all necessary steps to prepare for a commit. |
49 | | -precommit: tidy spellcheck apigen apidoc format lint editorconfig helm-test |
| 49 | +precommit: tidy spellcheck apigen codegen apidoc format lint editorconfig helm-test |
50 | 50 |
|
51 | 51 | .PHONY: lint |
52 | 52 | lint: ## This runs the linter on the codebase. |
@@ -116,6 +116,36 @@ apidoc: ## Generate API documentation for the API defined in the api directory. |
116 | 116 | --output-path site/docs/api/api.mdx \ |
117 | 117 | --renderer=markdown |
118 | 118 |
|
| 119 | +# This generates typed client, listers, and informers for the API. |
| 120 | +.PHONY: codegen |
| 121 | +codegen: ## Generate typed client, listers, and informers for the API. |
| 122 | + @echo "codegen => generating kubernetes clients..." |
| 123 | + @echo "codegen => generating clientset..." |
| 124 | + @$(GO_TOOL) client-gen \ |
| 125 | + --clientset-name="versioned" \ |
| 126 | + --input-base="" \ |
| 127 | + --input="github.com/envoyproxy/ai-gateway/api/v1alpha1" \ |
| 128 | + --go-header-file=/dev/null \ |
| 129 | + --output-dir="./api/v1alpha1/client/clientset" \ |
| 130 | + --output-pkg="github.com/envoyproxy/ai-gateway/api/v1alpha1/client/clientset" \ |
| 131 | + --plural-exceptions="BackendSecurityPolicy:BackendSecurityPolicies" |
| 132 | + @echo "codegen => generating listers..." |
| 133 | + @$(GO_TOOL) lister-gen \ |
| 134 | + --go-header-file=/dev/null \ |
| 135 | + --output-dir="./api/v1alpha1/client/listers" \ |
| 136 | + --output-pkg="github.com/envoyproxy/ai-gateway/api/v1alpha1/client/listers" \ |
| 137 | + --plural-exceptions="BackendSecurityPolicy:BackendSecurityPolicies" \ |
| 138 | + "github.com/envoyproxy/ai-gateway/api/v1alpha1" |
| 139 | + @echo "codegen => generating informers..." |
| 140 | + @$(GO_TOOL) informer-gen \ |
| 141 | + --go-header-file=/dev/null \ |
| 142 | + --versioned-clientset-package="github.com/envoyproxy/ai-gateway/api/v1alpha1/client/clientset/versioned" \ |
| 143 | + --listers-package="github.com/envoyproxy/ai-gateway/api/v1alpha1/client/listers" \ |
| 144 | + --output-dir="./api/v1alpha1/client/informers" \ |
| 145 | + --output-pkg="github.com/envoyproxy/ai-gateway/api/v1alpha1/client/informers" \ |
| 146 | + --plural-exceptions="BackendSecurityPolicy:BackendSecurityPolicies" \ |
| 147 | + "github.com/envoyproxy/ai-gateway/api/v1alpha1" |
| 148 | + @echo "codegen => complete" |
119 | 149 |
|
120 | 150 | ##@ Testing |
121 | 151 |
|
|
0 commit comments