You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a new type(type TopologyMap map[ResourceName][]string) in pkg/api/v1/types.go file.
And execute ./hack/update-generated-protobuf.sh to update pkg/api/v1/generated.proto file, but I got map<string, string> gTopology = 11;, a bit confusing, details as the below:
Why the value of map is string? Or something else I missed?
And then execute make quick-release command, got errors as the below:
plugin/cmd/kube-scheduler
# k8s.io/kubernetes/pkg/api/v1
pkg/api/v1/generated.pb.go:4734: arguments to copy have different element types: []byte and []string
pkg/api/v1/generated.pb.go:27251: cannot use mapvalue (type string) as type []string in assignment
!!! [0518 07:37:46] Call tree:
...
make: *** [quick-release] Error 1
The text was updated successfully, but these errors were encountered:
jianzhangbjz
changed the title
some problems about go-to-protobuf generated xxx.proto file
Cannot generate protobuf for map[string][]string
May 19, 2017
Refer to issue #27259 and PR #28788 fixed this problem. I have to define a new type for []string and add optional, like this:
typeTopologyMapmap[ResourceName]TopologyValue// TopologyValue masks the value so protobuf can generate// +protobuf.nullable=true// +protobuf.options.(gogoproto.goproto_stringer)=falsetypeTopologyValue []stringfunc (tTopologyValue) String() string {
returnfmt.Sprintf("%v", []string(t))
}
Hey guys,
I added a new type(
type TopologyMap map[ResourceName][]string
) inpkg/api/v1/types.go
file.And execute
./hack/update-generated-protobuf.sh
to updatepkg/api/v1/generated.proto
file, but I gotmap<string, string> gTopology = 11;
, a bit confusing, details as the below:pkg/api/v1/types.go
pkg/api/v1/generated.proto
// +optional map<string, string> gTopology = 11;
Why the value of map is
string
? Or something else I missed?And then execute
make quick-release
command, got errors as the below:The text was updated successfully, but these errors were encountered: