Skip to content

Commit e8fa0cf

Browse files
Merge pull request volcano-sh#90 from jinzhejz/update_conversion_m
update conversion gen
2 parents 960d474 + 616a086 commit e8fa0cf

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ git clone https://github.com/volcano-sh/apis.git
1313

1414
```shell
1515
bash ./hack/generate-groups.sh all volcano.sh/apis/pkg/client volcano.sh/apis/pkg/apis "batch:v1alpha1 bus:v1alpha1 nodeinfo:v1alpha1 scheduling:v1beta1" --go-header-file ./hack/boilerplate.go.txt
16+
bash ./hack/generate-groups.sh conversion volcano.sh/apis/pkg/client volcano.sh/apis/pkg/apis "scheduling:v1beta1" --go-header-file ./hack/boilerplate.go.txt
1617
```

hack/generate-groups.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ APIS_PKG="$3"
4646
GROUPS_WITH_VERSIONS="$4"
4747
shift 4
4848

49-
go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}@v0.23.0
49+
go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,conversion-gen}@v0.23.0
5050

5151
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
5252
GOBIN="$(go env GOBIN)"
@@ -89,3 +89,8 @@ if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then
8989
--output-package "${OUTPUT_PKG}/informers" \
9090
"$@"
9191
fi
92+
93+
if grep -qw "conversion" <<<"${GENS}"; then
94+
echo "Generating conversion funcs"
95+
"${gobin}/conversion-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.conversion "$@"
96+
fi

pkg/apis/scheduling/v1beta1/zz_generated.conversion.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)