A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/container-storage-interface/spec/issues/570 below:

1.10 generated files breaking changes · Issue #570 · container-storage-interface/spec · GitHub

Update to #552 has broken quite some Kubernetes CSI sidecars.

So far I identified two issues:

  1. gomock cannot easily compare two messages now. Protobuf now stores some private stuff in state field, e.g. NodeGetInfoResponse:

    type NodeGetInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields And this private field has quite random values.

    It is possible to implement a custom gomock matcher that compares just the public fields, or use proto.Equal, as suggested in https://protobuf.dev/reference/go/faq/#deepequal.

  2. It's not possible to copy message content. For example, this code copies value of NodeGetInfoResponse:

    nodeInfo, err := ctrl.GetNodeInfo(grpcClient, *operationTimeout)
    if err != nil {
        klog.Fatalf("Failed to get node info from CSI driver: %v", err)
    }
    nodeDeployment.NodeInfo = *nodeInfo

    Such a copy will copy also the private fields and one of the fields is sync.Mutex, which should not be copied (govet complains hard about it).
    In this particular case, the Kubernetes external-provisioner can use a pointer, it does not need to copy the struct content.

Both issues are solvable using proper protobuf functions (WIP PR here), but they were quite surprising for a minor go package bump.

I am not asking for a revert, just for a better communication of the breaking changes and semantic versioning of go packages. This should not be a minor package bump. There should be probably a separate repo with the generated go code, so we can bump the versions independently on CSI spec. Kubernetes solved this by calling all its go packages 0.x, so no go API stability should be expected, and they break their API from time to time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4