Skip to content

already_exists and already_published for CreateVolume and xxxPublishVolume RPCs #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion csi.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
////////
syntax = "proto3";
package csi;

import "google/protobuf/wrappers.proto";
////////
////////
service Identity {
Expand Down Expand Up @@ -159,6 +161,12 @@ message CreateVolumeResponse {
// relevant to the CO along with information required by the Plugin
// to uniquely identify the volume. This field is REQUIRED.
VolumeInfo volume_info = 1;

// A value of `true` indicates that a volume corresponding to the
// specified volume `name` already exists. This is not an error state
// and no recovery actions are expected of a CO.
// This field is OPTIONAL.
.google.protobuf.BoolValue already_exists = 2;
}

// Specify a capability of a volume.
Expand Down Expand Up @@ -328,6 +336,12 @@ message ControllerPublishVolumeResponse {
// the subsequent `NodePublishVolume` call for the given volume.
// This information is opaque to the CO. This field is OPTIONAL.
map<string, string> publish_volume_info = 1;

// A value of `true` indicates that a volume corresponding to the
// specified publishing criteria already exists. This is not an error
// state and no recovery actions are expected of a CO.
// This field is OPTIONAL.
.google.protobuf.BoolValue already_published = 2;
}
////////
////////
Expand Down Expand Up @@ -545,7 +559,13 @@ message NodePublishVolumeRequest {
map<string,string> volume_attributes = 8;
}

message NodePublishVolumeResponse {}
message NodePublishVolumeResponse {
// A value of `true` indicates that a volume corresponding to the
// specified publishing criteria already exists. This is not an error
// state and no recovery actions are expected of a CO.
// This field is OPTIONAL.
.google.protobuf.BoolValue already_published = 1;
}
////////
////////
message NodeUnpublishVolumeRequest {
Expand Down
1 change: 1 addition & 0 deletions lib/go/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/protoc-gen-go
/csi.a
/csi/.build/
/.protoc
6 changes: 4 additions & 2 deletions lib/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ $(PROTOC):
unzip "$(PROTOC_TMP_DIR)/$(PROTOC_ZIP)" -d "$(PROTOC_TMP_DIR)" && \
chmod 0755 "$(PROTOC_TMP_BIN)" && \
cp -f "$(PROTOC_TMP_BIN)" "$@"
-rm -fr "$(PROTOC_TMP_DIR)"
stat "$@" > /dev/null 2>&1


Expand Down Expand Up @@ -82,9 +81,12 @@ CSI_PROTO := ../../csi.proto
CSI_GO_TMP := csi/.build/csi.pb.go

# This recipe generates the go language bindings to a temp area.
$(CSI_GO_TMP): GO_OUT := plugins=grpc
$(CSI_GO_TMP): GO_OUT := $(GO_OUT),Mgoogle/protobuf/wrappers.proto=github.com/golang/protobuf/ptypes/wrappers
$(CSI_GO_TMP): INCLUDE = -I$(PROTOC_TMP_DIR)/include
$(CSI_GO_TMP): $(CSI_PROTO) | $(PROTOC) $(PROTOC_GEN_GO)
@mkdir -p "$(@D)"
$(PROTOC) -I "$(<D)" --go_out=plugins=grpc:"$(@D)" "$<"
$(PROTOC) -I "$(<D)" $(INCLUDE) --go_out=$(GO_OUT):"$(@D)" "$<"

# The temp language bindings are compared to the ones that are
# versioned. If they are different then it means the language
Expand Down
Loading