diff --git a/pkg/plugin/proto/v1alpha1/gen.go b/pkg/plugin/proto/v1alpha1/gen.go new file mode 100644 index 00000000..303b45b0 --- /dev/null +++ b/pkg/plugin/proto/v1alpha1/gen.go @@ -0,0 +1,8 @@ +package v1alpha1 + +//go:generate protoc --go_out=. -I. -I../../../../vendor --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative rollout.proto + +// Install the protoc-gen-go and protoc-gen-go-grpc plugins before generating the code. +// +// $ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest +// $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest diff --git a/pkg/plugin/proto/v1alpha1/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go new file mode 100644 index 00000000..64a4d77f --- /dev/null +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -0,0 +1,1016 @@ +// After making changes to the *.proto files, always run the following +// command in current directory to update the generated code: +// go generate + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.33.0 +// source: rollout.proto + +package v1alpha1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + runtime "k8s.io/apimachinery/pkg/runtime" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Result represents the validation result. +type ValidateResponse_Result int32 + +const ( + // RESULT_UNSPECIFIED is the unspecified result. + ValidateResponse_RESULT_UNSPECIFIED ValidateResponse_Result = 0 + // SUCCEEDED represents the successful result of the validation. + // MWRS Controller continues the rollout to the next group of clusters. + ValidateResponse_SUCCEEDED ValidateResponse_Result = 1 + // FAILED represents the failed result of the validation. + // MWRS Controller stops the current rollout and rollback is triggered if rollback is required. + ValidateResponse_FAILED ValidateResponse_Result = 2 + // INPROGRESS represents the state where the validation is still in progress. + // MWRS Controller keeps calling this method until the result is not INPROGRESS. + ValidateResponse_INPROGRESS ValidateResponse_Result = 3 +) + +// Enum value maps for ValidateResponse_Result. +var ( + ValidateResponse_Result_name = map[int32]string{ + 0: "RESULT_UNSPECIFIED", + 1: "SUCCEEDED", + 2: "FAILED", + 3: "INPROGRESS", + } + ValidateResponse_Result_value = map[string]int32{ + "RESULT_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "INPROGRESS": 3, + } +) + +func (x ValidateResponse_Result) Enum() *ValidateResponse_Result { + p := new(ValidateResponse_Result) + *p = x + return p +} + +func (x ValidateResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ValidateResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_rollout_proto_enumTypes[0].Descriptor() +} + +func (ValidateResponse_Result) Type() protoreflect.EnumType { + return &file_rollout_proto_enumTypes[0] +} + +func (x ValidateResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ValidateResponse_Result.Descriptor instead. +func (ValidateResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{7, 0} +} + +type MutateManifestWorkRequest_RolloutState int32 + +const ( + MutateManifestWorkRequest_ROLLOUT_STATE_UNSPECIFIED MutateManifestWorkRequest_RolloutState = 0 + // ROLLOUT indicates the manifestwork is being rolled out. + MutateManifestWorkRequest_ROLLOUT MutateManifestWorkRequest_RolloutState = 1 + // ABORT indicates the manifestwork is being aborted. + MutateManifestWorkRequest_ABORT MutateManifestWorkRequest_RolloutState = 2 +) + +// Enum value maps for MutateManifestWorkRequest_RolloutState. +var ( + MutateManifestWorkRequest_RolloutState_name = map[int32]string{ + 0: "ROLLOUT_STATE_UNSPECIFIED", + 1: "ROLLOUT", + 2: "ABORT", + } + MutateManifestWorkRequest_RolloutState_value = map[string]int32{ + "ROLLOUT_STATE_UNSPECIFIED": 0, + "ROLLOUT": 1, + "ABORT": 2, + } +) + +func (x MutateManifestWorkRequest_RolloutState) Enum() *MutateManifestWorkRequest_RolloutState { + p := new(MutateManifestWorkRequest_RolloutState) + *p = x + return p +} + +func (x MutateManifestWorkRequest_RolloutState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MutateManifestWorkRequest_RolloutState) Descriptor() protoreflect.EnumDescriptor { + return file_rollout_proto_enumTypes[1].Descriptor() +} + +func (MutateManifestWorkRequest_RolloutState) Type() protoreflect.EnumType { + return &file_rollout_proto_enumTypes[1] +} + +func (x MutateManifestWorkRequest_RolloutState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MutateManifestWorkRequest_RolloutState.Descriptor instead. +func (MutateManifestWorkRequest_RolloutState) EnumDescriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{8, 0} +} + +// InitializeRequest is the request to initialize the plugin. +type InitializeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // ocm_version is the version of the OCM API. + OcmVersion string `protobuf:"bytes,1,opt,name=ocm_version,json=ocmVersion,proto3" json:"ocm_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InitializeRequest) Reset() { + *x = InitializeRequest{} + mi := &file_rollout_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitializeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitializeRequest) ProtoMessage() {} + +func (x *InitializeRequest) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitializeRequest.ProtoReflect.Descriptor instead. +func (*InitializeRequest) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{0} +} + +func (x *InitializeRequest) GetOcmVersion() string { + if x != nil { + return x.OcmVersion + } + return "" +} + +// InitializeResponse is the response from the plugin after initialization. +// The plugin returns the name, version, and capabilities of the plugin. +type InitializeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // name is the name of the plugin. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // version is the version of the plugin. + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // capabilities is the capabilities of the plugin. + Capabilities *InitializeResponse_Capabilities `protobuf:"bytes,3,opt,name=capabilities,proto3" json:"capabilities,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InitializeResponse) Reset() { + *x = InitializeResponse{} + mi := &file_rollout_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitializeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitializeResponse) ProtoMessage() {} + +func (x *InitializeResponse) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitializeResponse.ProtoReflect.Descriptor instead. +func (*InitializeResponse) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{1} +} + +func (x *InitializeResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *InitializeResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *InitializeResponse) GetCapabilities() *InitializeResponse_Capabilities { + if x != nil { + return x.Capabilities + } + return nil +} + +// ClusterRolloutStatus represents the status of a cluster rollout. +type ClusterRolloutStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + // cluster_name is the name of the cluster. + ClusterName string `protobuf:"bytes,1,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"` + // rollout_status is the current status of the cluster rollout (e.g., "succeeded", "failed", "in_progress"). + RolloutStatus string `protobuf:"bytes,2,opt,name=rollout_status,json=rolloutStatus,proto3" json:"rollout_status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClusterRolloutStatus) Reset() { + *x = ClusterRolloutStatus{} + mi := &file_rollout_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClusterRolloutStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterRolloutStatus) ProtoMessage() {} + +func (x *ClusterRolloutStatus) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterRolloutStatus.ProtoReflect.Descriptor instead. +func (*ClusterRolloutStatus) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{2} +} + +func (x *ClusterRolloutStatus) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *ClusterRolloutStatus) GetRolloutStatus() string { + if x != nil { + return x.RolloutStatus + } + return "" +} + +// RolloutResult represents the current result of clusters in the rollout process. +type RolloutResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + // applied contains the clusters that have been successfully completed. + Applied []*ClusterRolloutStatus `protobuf:"bytes,1,rep,name=applied,proto3" json:"applied,omitempty"` + // to_rollout contains the clusters that are currently being rolled out. + ToRollout []*ClusterRolloutStatus `protobuf:"bytes,2,rep,name=to_rollout,json=toRollout,proto3" json:"to_rollout,omitempty"` + // timed_out contains the clusters that have timed out during the rollout. + TimedOut []*ClusterRolloutStatus `protobuf:"bytes,3,rep,name=timed_out,json=timedOut,proto3" json:"timed_out,omitempty"` + // removed contains the clusters that have been removed from the rollout. + Removed []*ClusterRolloutStatus `protobuf:"bytes,4,rep,name=removed,proto3" json:"removed,omitempty"` + // placement_total_clusters is the total number of clusters in the placement decision. + PlacementTotalClusters int32 `protobuf:"varint,6,opt,name=placement_total_clusters,json=placementTotalClusters,proto3" json:"placement_total_clusters,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RolloutResult) Reset() { + *x = RolloutResult{} + mi := &file_rollout_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RolloutResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RolloutResult) ProtoMessage() {} + +func (x *RolloutResult) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RolloutResult.ProtoReflect.Descriptor instead. +func (*RolloutResult) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{3} +} + +func (x *RolloutResult) GetApplied() []*ClusterRolloutStatus { + if x != nil { + return x.Applied + } + return nil +} + +func (x *RolloutResult) GetToRollout() []*ClusterRolloutStatus { + if x != nil { + return x.ToRollout + } + return nil +} + +func (x *RolloutResult) GetTimedOut() []*ClusterRolloutStatus { + if x != nil { + return x.TimedOut + } + return nil +} + +func (x *RolloutResult) GetRemoved() []*ClusterRolloutStatus { + if x != nil { + return x.Removed + } + return nil +} + +func (x *RolloutResult) GetPlacementTotalClusters() int32 { + if x != nil { + return x.PlacementTotalClusters + } + return 0 +} + +// RolloutMetadata contains the metadata of the rollout. +type RolloutMetadata struct { + state protoimpl.MessageState `protogen:"open.v1"` + // mwrs_name is the name of the manifestwork resource set. + MwrsName string `protobuf:"bytes,1,opt,name=mwrs_name,json=mwrsName,proto3" json:"mwrs_name,omitempty"` + // placement_name is the name of the placement. + PlacementName string `protobuf:"bytes,2,opt,name=placement_name,json=placementName,proto3" json:"placement_name,omitempty"` + // namespace is the namespace where the manifestwork resource set and placement are located. + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + // cluster_name is the name of the cluster. This field is optional and may not be present for all operations. + ClusterName *string `protobuf:"bytes,4,opt,name=cluster_name,json=clusterName,proto3,oneof" json:"cluster_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RolloutMetadata) Reset() { + *x = RolloutMetadata{} + mi := &file_rollout_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RolloutMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RolloutMetadata) ProtoMessage() {} + +func (x *RolloutMetadata) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RolloutMetadata.ProtoReflect.Descriptor instead. +func (*RolloutMetadata) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{4} +} + +func (x *RolloutMetadata) GetMwrsName() string { + if x != nil { + return x.MwrsName + } + return "" +} + +func (x *RolloutMetadata) GetPlacementName() string { + if x != nil { + return x.PlacementName + } + return "" +} + +func (x *RolloutMetadata) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *RolloutMetadata) GetClusterName() string { + if x != nil && x.ClusterName != nil { + return *x.ClusterName + } + return "" +} + +// RolloutPluginRequest is the request to the rollout plugin. +type RolloutPluginRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // metadata is the metadata of the rollout. + Metadata *RolloutMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // rollout_result is the result of the rollout. + RolloutResult *RolloutResult `protobuf:"bytes,2,opt,name=rollout_result,json=rolloutResult,proto3,oneof" json:"rollout_result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RolloutPluginRequest) Reset() { + *x = RolloutPluginRequest{} + mi := &file_rollout_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RolloutPluginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RolloutPluginRequest) ProtoMessage() {} + +func (x *RolloutPluginRequest) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RolloutPluginRequest.ProtoReflect.Descriptor instead. +func (*RolloutPluginRequest) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{5} +} + +func (x *RolloutPluginRequest) GetMetadata() *RolloutMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *RolloutPluginRequest) GetRolloutResult() *RolloutResult { + if x != nil { + return x.RolloutResult + } + return nil +} + +// ValidateCompletionRequest is the request to validate the completion of the rollout. +type ValidateCompletionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // metadata is the metadata of the rollout. + Metadata *RolloutMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateCompletionRequest) Reset() { + *x = ValidateCompletionRequest{} + mi := &file_rollout_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateCompletionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateCompletionRequest) ProtoMessage() {} + +func (x *ValidateCompletionRequest) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateCompletionRequest.ProtoReflect.Descriptor instead. +func (*ValidateCompletionRequest) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{6} +} + +func (x *ValidateCompletionRequest) GetMetadata() *RolloutMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +// ValidateResponse is the response from the plugin for the validation of the rollout or abort. +type ValidateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // result is the validation result. + Result ValidateResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse_Result" json:"result,omitempty"` + // Types that are valid to be assigned to Data: + // + // *ValidateResponse_TextData + // *ValidateResponse_ProtoData + Data isValidateResponse_Data `protobuf_oneof:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateResponse) Reset() { + *x = ValidateResponse{} + mi := &file_rollout_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateResponse) ProtoMessage() {} + +func (x *ValidateResponse) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateResponse.ProtoReflect.Descriptor instead. +func (*ValidateResponse) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{7} +} + +func (x *ValidateResponse) GetResult() ValidateResponse_Result { + if x != nil { + return x.Result + } + return ValidateResponse_RESULT_UNSPECIFIED +} + +func (x *ValidateResponse) GetData() isValidateResponse_Data { + if x != nil { + return x.Data + } + return nil +} + +func (x *ValidateResponse) GetTextData() string { + if x != nil { + if x, ok := x.Data.(*ValidateResponse_TextData); ok { + return x.TextData + } + } + return "" +} + +func (x *ValidateResponse) GetProtoData() *anypb.Any { + if x != nil { + if x, ok := x.Data.(*ValidateResponse_ProtoData); ok { + return x.ProtoData + } + } + return nil +} + +type isValidateResponse_Data interface { + isValidateResponse_Data() +} + +type ValidateResponse_TextData struct { + // text_data contains optional text data in the response. + TextData string `protobuf:"bytes,2,opt,name=text_data,json=textData,proto3,oneof"` +} + +type ValidateResponse_ProtoData struct { + // proto_data contains optional protobuf data in the response. + ProtoData *anypb.Any `protobuf:"bytes,3,opt,name=proto_data,json=protoData,proto3,oneof"` +} + +func (*ValidateResponse_TextData) isValidateResponse_Data() {} + +func (*ValidateResponse_ProtoData) isValidateResponse_Data() {} + +// MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied or aborted. +type MutateManifestWorkRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // rollout_state indicates the current state of the rollout operation. + RolloutState MutateManifestWorkRequest_RolloutState `protobuf:"varint,1,opt,name=rollout_state,json=rolloutState,proto3,enum=io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest_RolloutState" json:"rollout_state,omitempty"` + // metadata contains the metadata of the rollout. + Metadata *RolloutMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + // rollout_result contains the current result of the rollout. This field is optional. + RolloutResult *RolloutResult `protobuf:"bytes,3,opt,name=rollout_result,json=rolloutResult,proto3,oneof" json:"rollout_result,omitempty"` + // manifestwork is the unstructured manifestwork resource to be mutated. + Manifestwork *runtime.Unknown `protobuf:"bytes,4,opt,name=manifestwork,proto3" json:"manifestwork,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MutateManifestWorkRequest) Reset() { + *x = MutateManifestWorkRequest{} + mi := &file_rollout_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MutateManifestWorkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MutateManifestWorkRequest) ProtoMessage() {} + +func (x *MutateManifestWorkRequest) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MutateManifestWorkRequest.ProtoReflect.Descriptor instead. +func (*MutateManifestWorkRequest) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{8} +} + +func (x *MutateManifestWorkRequest) GetRolloutState() MutateManifestWorkRequest_RolloutState { + if x != nil { + return x.RolloutState + } + return MutateManifestWorkRequest_ROLLOUT_STATE_UNSPECIFIED +} + +func (x *MutateManifestWorkRequest) GetMetadata() *RolloutMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *MutateManifestWorkRequest) GetRolloutResult() *RolloutResult { + if x != nil { + return x.RolloutResult + } + return nil +} + +func (x *MutateManifestWorkRequest) GetManifestwork() *runtime.Unknown { + if x != nil { + return x.Manifestwork + } + return nil +} + +// MutateManifestWorkResponse is the response containing the mutated manifestwork resource. +type MutateManifestWorkResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // manifestwork is the mutated manifestwork resource. + Manifestwork *runtime.Unknown `protobuf:"bytes,1,opt,name=manifestwork,proto3" json:"manifestwork,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MutateManifestWorkResponse) Reset() { + *x = MutateManifestWorkResponse{} + mi := &file_rollout_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MutateManifestWorkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MutateManifestWorkResponse) ProtoMessage() {} + +func (x *MutateManifestWorkResponse) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MutateManifestWorkResponse.ProtoReflect.Descriptor instead. +func (*MutateManifestWorkResponse) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{9} +} + +func (x *MutateManifestWorkResponse) GetManifestwork() *runtime.Unknown { + if x != nil { + return x.Manifestwork + } + return nil +} + +type InitializeResponse_Capabilities struct { + state protoimpl.MessageState `protogen:"open.v1"` + // rollout indicates whether the plugin supports rollout operations. + Rollout bool `protobuf:"varint,1,opt,name=rollout,proto3" json:"rollout,omitempty"` + // abort indicates whether the plugin supports abort operations. + Abort bool `protobuf:"varint,2,opt,name=abort,proto3" json:"abort,omitempty"` + // mutate_manifestwork indicates whether the plugin can mutate the manifestwork resource. + MutateManifestwork bool `protobuf:"varint,3,opt,name=mutate_manifestwork,json=mutateManifestwork,proto3" json:"mutate_manifestwork,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InitializeResponse_Capabilities) Reset() { + *x = InitializeResponse_Capabilities{} + mi := &file_rollout_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitializeResponse_Capabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitializeResponse_Capabilities) ProtoMessage() {} + +func (x *InitializeResponse_Capabilities) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitializeResponse_Capabilities.ProtoReflect.Descriptor instead. +func (*InitializeResponse_Capabilities) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *InitializeResponse_Capabilities) GetRollout() bool { + if x != nil { + return x.Rollout + } + return false +} + +func (x *InitializeResponse_Capabilities) GetAbort() bool { + if x != nil { + return x.Abort + } + return false +} + +func (x *InitializeResponse_Capabilities) GetMutateManifestwork() bool { + if x != nil { + return x.MutateManifestwork + } + return false +} + +var File_rollout_proto protoreflect.FileDescriptor + +const file_rollout_proto_rawDesc = "" + + "\n" + + "\rrollout.proto\x124io.openclustermanagement.sdkgo.plugin.proto.v1alpha1\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a/k8s.io/apimachinery/pkg/runtime/generated.proto\"4\n" + + "\x11InitializeRequest\x12\x1f\n" + + "\vocm_version\x18\x01 \x01(\tR\n" + + "ocmVersion\"\xae\x02\n" + + "\x12InitializeResponse\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12y\n" + + "\fcapabilities\x18\x03 \x01(\v2U.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.CapabilitiesR\fcapabilities\x1ao\n" + + "\fCapabilities\x12\x18\n" + + "\arollout\x18\x01 \x01(\bR\arollout\x12\x14\n" + + "\x05abort\x18\x02 \x01(\bR\x05abort\x12/\n" + + "\x13mutate_manifestwork\x18\x03 \x01(\bR\x12mutateManifestwork\"`\n" + + "\x14ClusterRolloutStatus\x12!\n" + + "\fcluster_name\x18\x01 \x01(\tR\vclusterName\x12%\n" + + "\x0erollout_status\x18\x02 \x01(\tR\rrolloutStatus\"\xe9\x03\n" + + "\rRolloutResult\x12d\n" + + "\aapplied\x18\x01 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\aapplied\x12i\n" + + "\n" + + "to_rollout\x18\x02 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\ttoRollout\x12g\n" + + "\ttimed_out\x18\x03 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\btimedOut\x12d\n" + + "\aremoved\x18\x04 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\aremoved\x128\n" + + "\x18placement_total_clusters\x18\x06 \x01(\x05R\x16placementTotalClusters\"\xac\x01\n" + + "\x0fRolloutMetadata\x12\x1b\n" + + "\tmwrs_name\x18\x01 \x01(\tR\bmwrsName\x12%\n" + + "\x0eplacement_name\x18\x02 \x01(\tR\rplacementName\x12\x1c\n" + + "\tnamespace\x18\x03 \x01(\tR\tnamespace\x12&\n" + + "\fcluster_name\x18\x04 \x01(\tH\x00R\vclusterName\x88\x01\x01B\x0f\n" + + "\r_cluster_name\"\xfd\x01\n" + + "\x14RolloutPluginRequest\x12a\n" + + "\bmetadata\x18\x01 \x01(\v2E.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetadataR\bmetadata\x12o\n" + + "\x0erollout_result\x18\x02 \x01(\v2C.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResultH\x00R\rrolloutResult\x88\x01\x01B\x11\n" + + "\x0f_rollout_result\"~\n" + + "\x19ValidateCompletionRequest\x12a\n" + + "\bmetadata\x18\x01 \x01(\v2E.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetadataR\bmetadata\"\xa4\x02\n" + + "\x10ValidateResponse\x12e\n" + + "\x06result\x18\x01 \x01(\x0e2M.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.ResultR\x06result\x12\x1d\n" + + "\ttext_data\x18\x02 \x01(\tH\x00R\btextData\x125\n" + + "\n" + + "proto_data\x18\x03 \x01(\v2\x14.google.protobuf.AnyH\x00R\tprotoData\"K\n" + + "\x06Result\x12\x16\n" + + "\x12RESULT_UNSPECIFIED\x10\x00\x12\r\n" + + "\tSUCCEEDED\x10\x01\x12\n" + + "\n" + + "\x06FAILED\x10\x02\x12\x0e\n" + + "\n" + + "INPROGRESS\x10\x03B\x06\n" + + "\x04data\"\x9b\x04\n" + + "\x19MutateManifestWorkRequest\x12\x81\x01\n" + + "\rrollout_state\x18\x01 \x01(\x0e2\\.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutStateR\frolloutState\x12a\n" + + "\bmetadata\x18\x02 \x01(\v2E.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetadataR\bmetadata\x12o\n" + + "\x0erollout_result\x18\x03 \x01(\v2C.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResultH\x00R\rrolloutResult\x88\x01\x01\x12L\n" + + "\fmanifestwork\x18\x04 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork\"E\n" + + "\fRolloutState\x12\x1d\n" + + "\x19ROLLOUT_STATE_UNSPECIFIED\x10\x00\x12\v\n" + + "\aROLLOUT\x10\x01\x12\t\n" + + "\x05ABORT\x10\x02B\x11\n" + + "\x0f_rollout_result\"j\n" + + "\x1aMutateManifestWorkResponse\x12L\n" + + "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\xb0\t\n" + + "\x14RolloutPluginService\x12\x9f\x01\n" + + "\n" + + "Initialize\x12G.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest\x1aH.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse\x12r\n" + + "\fBeginRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12u\n" + + "\x0fProgressRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xb4\x01\n" + + "\x19ValidateRolloutCompletion\x12O.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateCompletionRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12p\n" + + "\n" + + "BeginAbort\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12s\n" + + "\rProgressAbort\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xb2\x01\n" + + "\x17ValidateAbortCompletion\x12O.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateCompletionRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12\xb7\x01\n" + + "\x12MutateManifestWork\x12O.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest\x1aP.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponseBBZ@open-cluster-management.io/sdk-go/plugin/proto/v1alpha1;v1alpha1b\x06proto3" + +var ( + file_rollout_proto_rawDescOnce sync.Once + file_rollout_proto_rawDescData []byte +) + +func file_rollout_proto_rawDescGZIP() []byte { + file_rollout_proto_rawDescOnce.Do(func() { + file_rollout_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_rollout_proto_rawDesc), len(file_rollout_proto_rawDesc))) + }) + return file_rollout_proto_rawDescData +} + +var file_rollout_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_rollout_proto_goTypes = []any{ + (ValidateResponse_Result)(0), // 0: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result + (MutateManifestWorkRequest_RolloutState)(0), // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState + (*InitializeRequest)(nil), // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest + (*InitializeResponse)(nil), // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse + (*ClusterRolloutStatus)(nil), // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + (*RolloutResult)(nil), // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult + (*RolloutMetadata)(nil), // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetadata + (*RolloutPluginRequest)(nil), // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + (*ValidateCompletionRequest)(nil), // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateCompletionRequest + (*ValidateResponse)(nil), // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + (*MutateManifestWorkRequest)(nil), // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest + (*MutateManifestWorkResponse)(nil), // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse + (*InitializeResponse_Capabilities)(nil), // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities + (*anypb.Any)(nil), // 13: google.protobuf.Any + (*runtime.Unknown)(nil), // 14: k8s.io.apimachinery.pkg.runtime.Unknown + (*emptypb.Empty)(nil), // 15: google.protobuf.Empty +} +var file_rollout_proto_depIdxs = []int32{ + 12, // 0: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.capabilities:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities + 4, // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult.applied:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 4, // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult.to_rollout:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 4, // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult.timed_out:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 4, // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult.removed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 6, // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetadata + 5, // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.rollout_result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult + 6, // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateCompletionRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetadata + 0, // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result + 13, // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.proto_data:type_name -> google.protobuf.Any + 1, // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_state:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState + 6, // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetadata + 5, // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult + 14, // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown + 14, // 14: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown + 2, // 15: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest + 7, // 16: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 17: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 18: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRolloutCompletion:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateCompletionRequest + 7, // 19: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginAbort:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressAbort:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateAbortCompletion:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateCompletionRequest + 10, // 22: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest + 3, // 23: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse + 15, // 24: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:output_type -> google.protobuf.Empty + 15, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:output_type -> google.protobuf.Empty + 9, // 26: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRolloutCompletion:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + 15, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginAbort:output_type -> google.protobuf.Empty + 15, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressAbort:output_type -> google.protobuf.Empty + 9, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateAbortCompletion:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + 11, // 30: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse + 23, // [23:31] is the sub-list for method output_type + 15, // [15:23] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_rollout_proto_init() } +func file_rollout_proto_init() { + if File_rollout_proto != nil { + return + } + file_rollout_proto_msgTypes[4].OneofWrappers = []any{} + file_rollout_proto_msgTypes[5].OneofWrappers = []any{} + file_rollout_proto_msgTypes[7].OneofWrappers = []any{ + (*ValidateResponse_TextData)(nil), + (*ValidateResponse_ProtoData)(nil), + } + file_rollout_proto_msgTypes[8].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_rollout_proto_rawDesc), len(file_rollout_proto_rawDesc)), + NumEnums: 2, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_rollout_proto_goTypes, + DependencyIndexes: file_rollout_proto_depIdxs, + EnumInfos: file_rollout_proto_enumTypes, + MessageInfos: file_rollout_proto_msgTypes, + }.Build() + File_rollout_proto = out.File + file_rollout_proto_goTypes = nil + file_rollout_proto_depIdxs = nil +} diff --git a/pkg/plugin/proto/v1alpha1/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto new file mode 100644 index 00000000..490ec6d8 --- /dev/null +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -0,0 +1,206 @@ +// After making changes to the *.proto files, always run the following +// command in current directory to update the generated code: +// go generate + +syntax = "proto3"; + +package io.openclustermanagement.sdkgo.plugin.proto.v1alpha1; + +import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; + +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; + +option go_package = "open-cluster-management.io/sdk-go/plugin/proto/v1alpha1;v1alpha1"; + +// RolloutPluginService is the service for the rollout plugin. +service RolloutPluginService { + // Initialize initializes the plugin. + rpc Initialize(InitializeRequest) returns (InitializeResponse); + + // BeginRollout is called before the manifestwork resource is applied. + // It is used to prepare the rollout. + rpc BeginRollout(RolloutPluginRequest) returns (google.protobuf.Empty); + + // ProgressRollout is called after the manifestwork is applied. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the rollout logic based on the feedback status changes. + rpc ProgressRollout(RolloutPluginRequest) returns (google.protobuf.Empty); + + // ValidateRolloutCompletion is called to validate the completion of the rollout. + // It is used to check if the rollout is completed successfully. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. + // If the validation is still in progress, the plugin should return an INPROGRESS result. + // If the validation fails, the plugin should return a FAILED result. + rpc ValidateRolloutCompletion(ValidateCompletionRequest) returns (ValidateResponse); + + // BeginAbort is called before the manifestwork resource is aborted. + // It is used to prepare the rollback. + rpc BeginAbort(RolloutPluginRequest) returns (google.protobuf.Empty); + + // ProgressAbort is called after the manifestwork is aborted. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the abort logic based on the feedback status changes. + rpc ProgressAbort(RolloutPluginRequest) returns (google.protobuf.Empty); + + // ValidateAbortCompletion is called to validate the completion of the abort. + // It is used to check if the abort is completed successfully. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. + // If the validation is still in progress, the plugin should return an INPROGRESS result. + // If the validation fails, the plugin should return a FAILED result. + rpc ValidateAbortCompletion(ValidateCompletionRequest) returns (ValidateResponse); + + // MutateManifestWork is called to mutate the manifestwork resource before it is applied or aborted. + // MWRS Controller provides the current rollout status to the plugin. + // The plugin can use this information to mutate the manifestwork resource. + rpc MutateManifestWork(MutateManifestWorkRequest) returns (MutateManifestWorkResponse); +} + +// InitializeRequest is the request to initialize the plugin. +message InitializeRequest { + // ocm_version is the version of the OCM API. + string ocm_version = 1; +} + +// InitializeResponse is the response from the plugin after initialization. +// The plugin returns the name, version, and capabilities of the plugin. +message InitializeResponse { + // name is the name of the plugin. + string name = 1; + + // version is the version of the plugin. + string version = 2; + + message Capabilities { + // rollout indicates whether the plugin supports rollout operations. + bool rollout = 1; + + // abort indicates whether the plugin supports abort operations. + bool abort = 2; + + // mutate_manifestwork indicates whether the plugin can mutate the manifestwork resource. + bool mutate_manifestwork = 3; + } + // capabilities is the capabilities of the plugin. + Capabilities capabilities = 3; +} + +// ClusterRolloutStatus represents the status of a cluster rollout. +message ClusterRolloutStatus { + // cluster_name is the name of the cluster. + string cluster_name = 1; + + // rollout_status is the current status of the cluster rollout (e.g., "succeeded", "failed", "in_progress"). + string rollout_status = 2; +} + +// RolloutResult represents the current result of clusters in the rollout process. +message RolloutResult { + // applied contains the clusters that have been successfully completed. + repeated ClusterRolloutStatus applied = 1; + + // to_rollout contains the clusters that are currently being rolled out. + repeated ClusterRolloutStatus to_rollout = 2; + + // timed_out contains the clusters that have timed out during the rollout. + repeated ClusterRolloutStatus timed_out = 3; + + // removed contains the clusters that have been removed from the rollout. + repeated ClusterRolloutStatus removed = 4; + + // placement_total_clusters is the total number of clusters in the placement decision. + int32 placement_total_clusters = 6; +} + +// RolloutMetadata contains the metadata of the rollout. +message RolloutMetadata { + // mwrs_name is the name of the manifestwork resource set. + string mwrs_name = 1; + + // placement_name is the name of the placement. + string placement_name = 2; + + // namespace is the namespace where the manifestwork resource set and placement are located. + string namespace = 3; + + // cluster_name is the name of the cluster. This field is optional and may not be present for all operations. + optional string cluster_name = 4; +} + +// RolloutPluginRequest is the request to the rollout plugin. +message RolloutPluginRequest { + // metadata is the metadata of the rollout. + RolloutMetadata metadata = 1; + + // rollout_result is the result of the rollout. + optional RolloutResult rollout_result = 2; +} + +// ValidateCompletionRequest is the request to validate the completion of the rollout. +message ValidateCompletionRequest { + // metadata is the metadata of the rollout. + RolloutMetadata metadata = 1; +} + +// ValidateResponse is the response from the plugin for the validation of the rollout or abort. +message ValidateResponse { + // Result represents the validation result. + enum Result { + // RESULT_UNSPECIFIED is the unspecified result. + RESULT_UNSPECIFIED = 0; + + // SUCCEEDED represents the successful result of the validation. + // MWRS Controller continues the rollout to the next group of clusters. + SUCCEEDED = 1; + + // FAILED represents the failed result of the validation. + // MWRS Controller stops the current rollout and rollback is triggered if rollback is required. + FAILED = 2; + + // INPROGRESS represents the state where the validation is still in progress. + // MWRS Controller keeps calling this method until the result is not INPROGRESS. + INPROGRESS = 3; + } + + // result is the validation result. + Result result = 1; + + oneof data { + // text_data contains optional text data in the response. + string text_data = 2; + + // proto_data contains optional protobuf data in the response. + google.protobuf.Any proto_data = 3; + } +} + +// MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied or aborted. +message MutateManifestWorkRequest { + enum RolloutState { + ROLLOUT_STATE_UNSPECIFIED = 0; + + // ROLLOUT indicates the manifestwork is being rolled out. + ROLLOUT = 1; + + // ABORT indicates the manifestwork is being aborted. + ABORT = 2; + } + + // rollout_state indicates the current state of the rollout operation. + RolloutState rollout_state = 1; + + // metadata contains the metadata of the rollout. + RolloutMetadata metadata = 2; + + // rollout_result contains the current result of the rollout. This field is optional. + optional RolloutResult rollout_result = 3; + + // manifestwork is the unstructured manifestwork resource to be mutated. + k8s.io.apimachinery.pkg.runtime.Unknown manifestwork = 4; +} + +// MutateManifestWorkResponse is the response containing the mutated manifestwork resource. +message MutateManifestWorkResponse { + // manifestwork is the mutated manifestwork resource. + k8s.io.apimachinery.pkg.runtime.Unknown manifestwork = 1; +} \ No newline at end of file diff --git a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go new file mode 100644 index 00000000..9433571f --- /dev/null +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -0,0 +1,444 @@ +// After making changes to the *.proto files, always run the following +// command in current directory to update the generated code: +// go generate + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v6.33.0 +// source: rollout.proto + +package v1alpha1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + RolloutPluginService_Initialize_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/Initialize" + RolloutPluginService_BeginRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/BeginRollout" + RolloutPluginService_ProgressRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ProgressRollout" + RolloutPluginService_ValidateRolloutCompletion_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateRolloutCompletion" + RolloutPluginService_BeginAbort_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/BeginAbort" + RolloutPluginService_ProgressAbort_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ProgressAbort" + RolloutPluginService_ValidateAbortCompletion_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateAbortCompletion" + RolloutPluginService_MutateManifestWork_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/MutateManifestWork" +) + +// RolloutPluginServiceClient is the client API for RolloutPluginService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// RolloutPluginService is the service for the rollout plugin. +type RolloutPluginServiceClient interface { + // Initialize initializes the plugin. + Initialize(ctx context.Context, in *InitializeRequest, opts ...grpc.CallOption) (*InitializeResponse, error) + // BeginRollout is called before the manifestwork resource is applied. + // It is used to prepare the rollout. + BeginRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // ProgressRollout is called after the manifestwork is applied. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the rollout logic based on the feedback status changes. + ProgressRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // ValidateRolloutCompletion is called to validate the completion of the rollout. + // It is used to check if the rollout is completed successfully. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. + // If the validation is still in progress, the plugin should return an INPROGRESS result. + // If the validation fails, the plugin should return a FAILED result. + ValidateRolloutCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) + // BeginAbort is called before the manifestwork resource is aborted. + // It is used to prepare the rollback. + BeginAbort(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // ProgressAbort is called after the manifestwork is aborted. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the abort logic based on the feedback status changes. + ProgressAbort(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // ValidateAbortCompletion is called to validate the completion of the abort. + // It is used to check if the abort is completed successfully. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. + // If the validation is still in progress, the plugin should return an INPROGRESS result. + // If the validation fails, the plugin should return a FAILED result. + ValidateAbortCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) + // MutateManifestWork is called to mutate the manifestwork resource before it is applied or aborted. + // MWRS Controller provides the current rollout status to the plugin. + // The plugin can use this information to mutate the manifestwork resource. + MutateManifestWork(ctx context.Context, in *MutateManifestWorkRequest, opts ...grpc.CallOption) (*MutateManifestWorkResponse, error) +} + +type rolloutPluginServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRolloutPluginServiceClient(cc grpc.ClientConnInterface) RolloutPluginServiceClient { + return &rolloutPluginServiceClient{cc} +} + +func (c *rolloutPluginServiceClient) Initialize(ctx context.Context, in *InitializeRequest, opts ...grpc.CallOption) (*InitializeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InitializeResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_Initialize_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) BeginRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RolloutPluginService_BeginRollout_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) ProgressRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RolloutPluginService_ProgressRollout_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) ValidateRolloutCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValidateResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRolloutCompletion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) BeginAbort(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RolloutPluginService_BeginAbort_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) ProgressAbort(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, RolloutPluginService_ProgressAbort_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) ValidateAbortCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValidateResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_ValidateAbortCompletion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) MutateManifestWork(ctx context.Context, in *MutateManifestWorkRequest, opts ...grpc.CallOption) (*MutateManifestWorkResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MutateManifestWorkResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_MutateManifestWork_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RolloutPluginServiceServer is the server API for RolloutPluginService service. +// All implementations must embed UnimplementedRolloutPluginServiceServer +// for forward compatibility. +// +// RolloutPluginService is the service for the rollout plugin. +type RolloutPluginServiceServer interface { + // Initialize initializes the plugin. + Initialize(context.Context, *InitializeRequest) (*InitializeResponse, error) + // BeginRollout is called before the manifestwork resource is applied. + // It is used to prepare the rollout. + BeginRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) + // ProgressRollout is called after the manifestwork is applied. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the rollout logic based on the feedback status changes. + ProgressRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) + // ValidateRolloutCompletion is called to validate the completion of the rollout. + // It is used to check if the rollout is completed successfully. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. + // If the validation is still in progress, the plugin should return an INPROGRESS result. + // If the validation fails, the plugin should return a FAILED result. + ValidateRolloutCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) + // BeginAbort is called before the manifestwork resource is aborted. + // It is used to prepare the rollback. + BeginAbort(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) + // ProgressAbort is called after the manifestwork is aborted. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the abort logic based on the feedback status changes. + ProgressAbort(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) + // ValidateAbortCompletion is called to validate the completion of the abort. + // It is used to check if the abort is completed successfully. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. + // If the validation is still in progress, the plugin should return an INPROGRESS result. + // If the validation fails, the plugin should return a FAILED result. + ValidateAbortCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) + // MutateManifestWork is called to mutate the manifestwork resource before it is applied or aborted. + // MWRS Controller provides the current rollout status to the plugin. + // The plugin can use this information to mutate the manifestwork resource. + MutateManifestWork(context.Context, *MutateManifestWorkRequest) (*MutateManifestWorkResponse, error) + mustEmbedUnimplementedRolloutPluginServiceServer() +} + +// UnimplementedRolloutPluginServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedRolloutPluginServiceServer struct{} + +func (UnimplementedRolloutPluginServiceServer) Initialize(context.Context, *InitializeRequest) (*InitializeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented") +} +func (UnimplementedRolloutPluginServiceServer) BeginRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginRollout not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ProgressRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProgressRollout not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ValidateRolloutCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateRolloutCompletion not implemented") +} +func (UnimplementedRolloutPluginServiceServer) BeginAbort(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginAbort not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ProgressAbort(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProgressAbort not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ValidateAbortCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateAbortCompletion not implemented") +} +func (UnimplementedRolloutPluginServiceServer) MutateManifestWork(context.Context, *MutateManifestWorkRequest) (*MutateManifestWorkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MutateManifestWork not implemented") +} +func (UnimplementedRolloutPluginServiceServer) mustEmbedUnimplementedRolloutPluginServiceServer() {} +func (UnimplementedRolloutPluginServiceServer) testEmbeddedByValue() {} + +// UnsafeRolloutPluginServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RolloutPluginServiceServer will +// result in compilation errors. +type UnsafeRolloutPluginServiceServer interface { + mustEmbedUnimplementedRolloutPluginServiceServer() +} + +func RegisterRolloutPluginServiceServer(s grpc.ServiceRegistrar, srv RolloutPluginServiceServer) { + // If the following call pancis, it indicates UnimplementedRolloutPluginServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&RolloutPluginService_ServiceDesc, srv) +} + +func _RolloutPluginService_Initialize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitializeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).Initialize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_Initialize_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).Initialize(ctx, req.(*InitializeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_BeginRollout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RolloutPluginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).BeginRollout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_BeginRollout_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).BeginRollout(ctx, req.(*RolloutPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_ProgressRollout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RolloutPluginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).ProgressRollout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_ProgressRollout_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).ProgressRollout(ctx, req.(*RolloutPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_ValidateRolloutCompletion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateCompletionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).ValidateRolloutCompletion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_ValidateRolloutCompletion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).ValidateRolloutCompletion(ctx, req.(*ValidateCompletionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_BeginAbort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RolloutPluginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).BeginAbort(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_BeginAbort_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).BeginAbort(ctx, req.(*RolloutPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_ProgressAbort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RolloutPluginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).ProgressAbort(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_ProgressAbort_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).ProgressAbort(ctx, req.(*RolloutPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_ValidateAbortCompletion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateCompletionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).ValidateAbortCompletion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_ValidateAbortCompletion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).ValidateAbortCompletion(ctx, req.(*ValidateCompletionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_MutateManifestWork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MutateManifestWorkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).MutateManifestWork(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_MutateManifestWork_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).MutateManifestWork(ctx, req.(*MutateManifestWorkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RolloutPluginService_ServiceDesc is the grpc.ServiceDesc for RolloutPluginService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RolloutPluginService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService", + HandlerType: (*RolloutPluginServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Initialize", + Handler: _RolloutPluginService_Initialize_Handler, + }, + { + MethodName: "BeginRollout", + Handler: _RolloutPluginService_BeginRollout_Handler, + }, + { + MethodName: "ProgressRollout", + Handler: _RolloutPluginService_ProgressRollout_Handler, + }, + { + MethodName: "ValidateRolloutCompletion", + Handler: _RolloutPluginService_ValidateRolloutCompletion_Handler, + }, + { + MethodName: "BeginAbort", + Handler: _RolloutPluginService_BeginAbort_Handler, + }, + { + MethodName: "ProgressAbort", + Handler: _RolloutPluginService_ProgressAbort_Handler, + }, + { + MethodName: "ValidateAbortCompletion", + Handler: _RolloutPluginService_ValidateAbortCompletion_Handler, + }, + { + MethodName: "MutateManifestWork", + Handler: _RolloutPluginService_MutateManifestWork_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "rollout.proto", +}