Skip to content

Commit d8e1b99

Browse files
committed
UPSTREAM: <carry>: don't use --prefers-protobuf with client-gen
kcp doesn't implement protobuf codec yet, and so we need to disable it in the client code. This commit comments out --prefers-protobuf command line flag when invoking client-gen in update-codegen.sh scripts in various places. TODO: revert once kcp gains protobuf support. On-behalf-of: SAP [email protected] Signed-off-by: Robert Vasek <[email protected]>
1 parent 5531d0b commit d8e1b99

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

hack/update-codegen.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ function codegen::clients() {
690690
|| true) \
691691
| xargs -0 rm -f
692692

693+
# kcp: TODO(gman0) re-add `--prefers-protobuf` once kcp-dev/{client-go,kcp} supports protobuf codec.
693694
client-gen \
694695
-v "${KUBE_VERBOSE}" \
695696
--go-header-file "${BOILERPLATE_FILENAME}" \
@@ -699,10 +700,10 @@ function codegen::clients() {
699700
--input-base="k8s.io/api" \
700701
--plural-exceptions "${PLURAL_EXCEPTIONS}" \
701702
--apply-configuration-package "${APPLYCONFIG_PKG}" \
702-
--prefers-protobuf \
703703
$(printf -- " --input %s" "${gv_dirs[@]}") \
704704
"$@"
705705

706+
706707
if [[ "${DBG_CODEGEN}" == 1 ]]; then
707708
kube::log::status "Generated client code"
708709
fi

staging/src/k8s.io/apiextensions-apiserver/hack/update-codegen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ kube::codegen::gen_openapi \
4545
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
4646
"${SCRIPT_ROOT}/pkg"
4747

48+
# kcp: TODO(gman0) re-add `--prefers-protobuf` once kcp-dev/{client-go,kcp} supports protobuf codec.
4849
kube::codegen::gen_client \
4950
--with-watch \
5051
--with-applyconfig \
5152
--output-dir "${SCRIPT_ROOT}/pkg/client" \
5253
--output-pkg "${THIS_PKG}/pkg/client" \
5354
--versioned-name "clientset" \
5455
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
55-
--prefers-protobuf \
5656
"${SCRIPT_ROOT}/pkg/apis"

staging/src/k8s.io/kube-aggregator/hack/update-codegen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ kube::codegen::gen_openapi \
4444
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
4545
"${SCRIPT_ROOT}/pkg/apis"
4646

47+
# kcp: TODO(gman0) re-add `--prefers-protobuf` once kcp-dev/{client-go,kcp} supports protobuf codec.
4748
kube::codegen::gen_client \
4849
--with-watch \
4950
--output-dir "${SCRIPT_ROOT}/pkg/client" \
5051
--output-pkg "${THIS_PKG}/pkg/client" \
5152
--clientset-name "clientset_generated" \
5253
--versioned-name "clientset" \
5354
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
54-
--prefers-protobuf \
5555
"${SCRIPT_ROOT}/pkg/apis"

staging/src/k8s.io/metrics/hack/update-codegen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ kube::codegen::gen_helpers \
3232
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
3333
"${SCRIPT_ROOT}/pkg/apis"
3434

35+
# kcp: TODO(gman0) re-add `--prefers-protobuf` once kcp-dev/{client-go,kcp} supports protobuf codec.
3536
kube::codegen::gen_client \
3637
--output-dir "${SCRIPT_ROOT}/pkg/client" \
3738
--output-pkg "${THIS_PKG}/pkg/client" \
3839
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
39-
--prefers-protobuf \
4040
"${SCRIPT_ROOT}/pkg/apis"

0 commit comments

Comments
 (0)