mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-06 08:47:04 +00:00
Enable transmitting the discovered "raw" features over the gRPC API. Extend pkg/api/feature with protobuf and gRPC code. In this, utilize go-to-protobuf from k8s code-generator for auto-generating the gRPC interface from golang code. The tool can be Installed with: go install k8s.io/code-generator/cmd/go-to-protobuf@v0.20.7 The auto-generated code is (re-)generated/updated with "make apigen".
16 lines
553 B
Bash
Executable file
16 lines
553 B
Bash
Executable file
#!/bin/sh -ex
|
|
|
|
# go-to-protobuf seems unable to run in the package directory -> move to parent dir
|
|
cd ..
|
|
go-to-protobuf \
|
|
--output-base=. \
|
|
--go-header-file ../../hack/boilerplate.go.txt \
|
|
--proto-import ../../vendor \
|
|
--packages ./feature=feature \
|
|
--keep-gogoproto=false \
|
|
--apimachinery-packages "-k8s.io/apimachinery/pkg/util/intstr"
|
|
cd -
|
|
|
|
# Mangle the go_package option to comply with newer versions protoc-gen-go
|
|
sed s',go_package =.*,go_package = "sigs.k8s.io/node-feature-discovery/pkg/api/feature";,' \
|
|
-i generated.proto
|