Skip to content

Commit ff7fbdd

Browse files
authored
Merge pull request #9 from Electronic-Waste/feat/openapi-gen
feat: Generate OpenAPI specification for Tenant and Warehouse APIs.
2 parents 45ee5d2 + 9aeb5b0 commit ff7fbdd

File tree

4 files changed

+1040
-0
lines changed

4 files changed

+1040
-0
lines changed

hack/update-codegen.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,16 @@ kube::codegen::gen_client \
2727
--with-watch \
2828
--with-applyconfig \
2929
"${DATABEND_OPERATOR_ROOT}/pkg/apis"
30+
31+
# Get the kube-openapi binary.
32+
OPENAPI_PKG=$(go list -m -mod=readonly -f "{{.Dir}}" k8s.io/kube-openapi)
33+
echo ">> Using ${OPENAPI_PKG}"
34+
35+
echo "Generating OpenAPI specification for databendlabs.io/v1alpha1"
36+
go run ${OPENAPI_PKG}/cmd/openapi-gen \
37+
--go-header-file "${DATABEND_OPERATOR_ROOT}/hack/boilerplate.go.txt" \
38+
--output-pkg "${DATABEND_OPERATOR_PKG}/pkg/apis/databendlabs.io/v1alpha1" \
39+
--output-dir "${DATABEND_OPERATOR_ROOT}/pkg/apis/databendlabs.io/v1alpha1" \
40+
--output-file "zz_generated.openapi.go" \
41+
--report-filename "${DATABEND_OPERATOR_ROOT}/hack/violation_exception_v1alpha1.list" \
42+
"${DATABEND_OPERATOR_ROOT}/pkg/apis/databendlabs.io/v1alpha1"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
API rule violation: list_type_missing,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,MetaConfig,Endpoints
2+
API rule violation: list_type_missing,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,WarehouseSpec,PodTolerations
3+
API rule violation: names_match,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,DiskCacheSpec,MaxBytes
4+
API rule violation: names_match,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,MetaConfig,TimeoutInSeconds
5+
API rule violation: names_match,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,WarehouseSpec,Cache
6+
API rule violation: names_match,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,WarehouseSpec,PodLabels
7+
API rule violation: names_match,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,WarehouseSpec,PodResource
8+
API rule violation: names_match,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,WarehouseSpec,PodTolerations
9+
API rule violation: names_match,github.com/databendcloud/databend-operator/pkg/apis/databendlabs.io/v1alpha1,WarehouseStatus,Conditions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Copyright 2024.
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+
// +k8s:defaulter-gen=TypeMeta
18+
// +k8s:openapi-gen=true
19+
// +k8s:deepcopy-gen=package
20+
21+
// Package v1alpha1 is the v1alpha1 version of the API.
22+
// +groupName=databendlabs.io
23+
24+
package v1alpha1

0 commit comments

Comments
 (0)