From 57a4e2a5d3f22aca9963d735f3b20262c28ef237 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Fri, 24 Oct 2025 07:45:02 -0700 Subject: [PATCH 1/9] initial commit of rollout protobuf --- pkg/plugin/rollout.proto | 225 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 pkg/plugin/rollout.proto diff --git a/pkg/plugin/rollout.proto b/pkg/plugin/rollout.proto new file mode 100644 index 00000000..5fe32abe --- /dev/null +++ b/pkg/plugin/rollout.proto @@ -0,0 +1,225 @@ +syntax = "proto3"; + +package open-cluster-management.io.sdk-go.plugin; + +import "google/protobuf/struct.proto"; + +option go_package = "open-cluster-management.io/sdk-go/pkg/plugin;plugin"; + +// RolloutPluginService is the service for the rollout plugin. +service RolloutPluginService { + // InitPlugin initializes the plugin + rpc InitPlugin(InitPluginRequest) returns (InitPluginResponse); + + // BeginRollout is called before the manifestwork resource is applied. + // It is used to prepare the rollout. + rpc BeginRollout(RolloutPluginRequest) returns (RolloutPluginResponse); + + // 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 (RolloutPluginResponse); + + // ValidateRollout 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 OK result. + // If the validation is still in progress, the plugin should return a INPROGRESS result. + // If the validation is failed, the plugin should return a FAILED result. + rpc ValidateRollout(RolloutPluginRequest) returns (ValidateRolloutResponse); + + // BeginRollback is called before the manifestwork resource is rolled back. + // It is used to prepare the rollback. + rpc BeginRollback(RolloutPluginRequest) returns (RolloutPluginResponse); + + // ProgressRollback is called after the manifestwork is rolled back. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the rollback logic based on the feedback status changes. + rpc ProgressRollback(RolloutPluginRequest) returns (RolloutPluginResponse); + + // ValidateRollback is called to validate the completion of the rollback. + // It is used to check if the rollback is completed successfully. + // If the validation is completed successfully, the plugin should return a OK result. + // If the validation is still in progress, the plugin should return a INPROGRESS result. + // If the validation is failed, the plugin should return a FAILED result. + rpc ValidateRollback(RolloutPluginRequest) returns (ValidateRolloutResponse); + + // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. + // 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); +} + +// InitPluginRequest is the request to initialize the plugin. +message InitPluginRequest { + // ocm_version is the version of the OCM API. + string ocm_version = 1; +} + +// InitPluginResponse is the response to initialize the plugin. +message InitPluginResponse { + // name is the name of the plugin. + string name = 1; + + // version is the version of the plugin. + string version = 2; + + message Capabilities { + // rollout is the capability to rollout. + bool rollout = 1; + + // rollback is the capability to rollback. + bool rollback = 2; + + // mutate_manifestwork is the capability to mutate the manifestwork resource. + bool mutate_manifestwork = 3; + } + // capabilities is the capabilities of the plugin. + Capabilities capabilities = 3; +} + +// ClusterRolloutStatus is the status of the cluster rollout. +message ClusterRolloutStatus { + // name is the name of the cluster. + string name = 1; + + // rollout_status is the status of the cluster rollout. + string rollout_status = 2; +} + +// RolloutDetails is the details of the rollout. +message RolloutDetails { + // placement_total_clusters is the total clusters in placement decision. + int32 placement_total_clusters = 1; + + // completed is the clusters that have been completed. + repeated ClusterRolloutStatus completed = 1; + + // in_progress is the clusters that are currently being rolled out. + repeated ClusterRolloutStatus in_progress = 2; + + // timed_out is the clusters that have timed out. + repeated ClusterRolloutStatus timed_out = 3; + + // removed is the clusters that have been removed. + repeated ClusterRolloutStatus removed = 4; +} + +message RolloutMeta { + // 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 mwrs and placement are located. + string namespace = 3; + + // cluster_name is the name of the cluster. + optional string cluster_name = 4; +} + +// RolloutPluginRequest is the request to the rollout plugin. +message RolloutPluginRequest { + // metadata is the metadata of the rollout. + RolloutMeta metadata = 1; + + // rollout_details is the details of the rollout. + optional RolloutDetails rollout_details = 7; +} + +// RolloutPluginResponse is the response from the plugin. +message RolloutPluginResponse { + // Result is the result of the plugin response. + enum Result { + RESULT_UNSPECIFIED = 0; + + // OK is the ok response. + OK = 1; + + // FAILED is the failed response. + FAILED = 2; + } + + // result is the result of the response. + Result result = 1; + + // details is the message of the response. + optional string details = 2; +} + +// ValidateRolloutResponse is the response from the plugin for the validation of the rollout. +message ValidateRolloutResponse { + // Result is the result of the validation response. + enum Result { + // RESULT_UNSPECIFIED is the unspecified result. + RESULT_UNSPECIFIED = 0; + + // OK is the ok result. + OK = 1; + + // FAILED is the failed result. + FAILED = 2; + + // INPROGRESS is the state where the validation is still in progress. + // MWRS Controller will keep calling this method until the result is not INPROGRESS. + INPROGRESS = 3; + } + + // result is the result of the response. + Result result = 1; + + // details is the message of the response. + optional string details = 2; +} + +// MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied. +message MutateManifestWorkRequest { + enum Type { + TYPE_UNSPECIFIED = 0; + + // ROLLOUT is the type of the mutation for the rollout. + ROLLOUT = 1; + + // ROLLBACK is the type of the mutation for the rollback. + ROLLBACK = 2; + } + + // type is the type of the mutation. + Type type = 1; + + // metadata is the metadata of the rollout. + RolloutMeta metadata = 2; + + // rollout_details is the details of the rollout. + optional RolloutDetails rollout_details = 3; + + // manifestwork is the unstructured manifestwork resource. + RuntimeObject manifestwork = 4; +} + +// MutateManifestWorkResponse is the response to mutate the manifestwork resource before it is applied. +message MutateManifestWorkResponse { + // manifestwork is the mutated manifestwork resource. + RuntimeObject manifestwork = 1; +} + +// TypeMeta is the type meta of the kubernetes runtime object. +message TypeMeta { + string api_version = 1; + + string kind = 2; +} + +// RuntimeObject is the kubernetes runtime object. +message RuntimeObject { + TypeMeta type_meta = 1; + + // Raw will hold the complete serialized object which couldn't be matched + // with a registered type. Most likely, nothing should be done with this + // except for passing it through the system. + bytes raw = 2; + + // ContentType is serialization method used to serialize 'Raw'. + // Unspecified means ContentTypeJSON. + string contentType = 3; +} From bf853fe89b1d57ea754af33e8b2d12d6fb5e5741 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Fri, 24 Oct 2025 12:12:44 -0700 Subject: [PATCH 2/9] generate code --- pkg/plugin/gen.go | 8 + pkg/plugin/rollout.pb.go | 1255 +++++++++++++++++++++++++++++++++ pkg/plugin/rollout.proto | 58 +- pkg/plugin/rollout_grpc.pb.go | 443 ++++++++++++ 4 files changed, 1745 insertions(+), 19 deletions(-) create mode 100644 pkg/plugin/gen.go create mode 100644 pkg/plugin/rollout.pb.go create mode 100644 pkg/plugin/rollout_grpc.pb.go diff --git a/pkg/plugin/gen.go b/pkg/plugin/gen.go new file mode 100644 index 00000000..018f9ba6 --- /dev/null +++ b/pkg/plugin/gen.go @@ -0,0 +1,8 @@ +package plugin + +//go:generate protoc --go_out=. --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/rollout.pb.go b/pkg/plugin/rollout.pb.go new file mode 100644 index 00000000..cd9c0630 --- /dev/null +++ b/pkg/plugin/rollout.pb.go @@ -0,0 +1,1255 @@ +// 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 plugin + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + 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 is the result of the plugin response. +type RolloutPluginResponse_Result int32 + +const ( + RolloutPluginResponse_RESULT_UNSPECIFIED RolloutPluginResponse_Result = 0 + // OK is the ok response. + RolloutPluginResponse_OK RolloutPluginResponse_Result = 1 + // FAILED is the failed response. + RolloutPluginResponse_FAILED RolloutPluginResponse_Result = 2 +) + +// Enum value maps for RolloutPluginResponse_Result. +var ( + RolloutPluginResponse_Result_name = map[int32]string{ + 0: "RESULT_UNSPECIFIED", + 1: "OK", + 2: "FAILED", + } + RolloutPluginResponse_Result_value = map[string]int32{ + "RESULT_UNSPECIFIED": 0, + "OK": 1, + "FAILED": 2, + } +) + +func (x RolloutPluginResponse_Result) Enum() *RolloutPluginResponse_Result { + p := new(RolloutPluginResponse_Result) + *p = x + return p +} + +func (x RolloutPluginResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RolloutPluginResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_rollout_proto_enumTypes[0].Descriptor() +} + +func (RolloutPluginResponse_Result) Type() protoreflect.EnumType { + return &file_rollout_proto_enumTypes[0] +} + +func (x RolloutPluginResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RolloutPluginResponse_Result.Descriptor instead. +func (RolloutPluginResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{6, 0} +} + +// Result is the result of the validation response. +type ValidateRolloutResponse_Result int32 + +const ( + // RESULT_UNSPECIFIED is the unspecified result. + ValidateRolloutResponse_RESULT_UNSPECIFIED ValidateRolloutResponse_Result = 0 + // SUCCEEDED represents the successful result of the validation. + // MWRS Controller continues the rollout to the next group of clusters. + ValidateRolloutResponse_SUCCEEDED ValidateRolloutResponse_Result = 1 + // FAILED represents the failed result of the validation. + // MWRS Controller stops the current rollout and rollback is triggered if the rollback is required. + ValidateRolloutResponse_FAILED ValidateRolloutResponse_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. + ValidateRolloutResponse_INPROGRESS ValidateRolloutResponse_Result = 3 +) + +// Enum value maps for ValidateRolloutResponse_Result. +var ( + ValidateRolloutResponse_Result_name = map[int32]string{ + 0: "RESULT_UNSPECIFIED", + 1: "SUCCEEDED", + 2: "FAILED", + 3: "INPROGRESS", + } + ValidateRolloutResponse_Result_value = map[string]int32{ + "RESULT_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "INPROGRESS": 3, + } +) + +func (x ValidateRolloutResponse_Result) Enum() *ValidateRolloutResponse_Result { + p := new(ValidateRolloutResponse_Result) + *p = x + return p +} + +func (x ValidateRolloutResponse_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ValidateRolloutResponse_Result) Descriptor() protoreflect.EnumDescriptor { + return file_rollout_proto_enumTypes[1].Descriptor() +} + +func (ValidateRolloutResponse_Result) Type() protoreflect.EnumType { + return &file_rollout_proto_enumTypes[1] +} + +func (x ValidateRolloutResponse_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ValidateRolloutResponse_Result.Descriptor instead. +func (ValidateRolloutResponse_Result) EnumDescriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{7, 0} +} + +type MutateManifestWorkRequest_Type int32 + +const ( + MutateManifestWorkRequest_TYPE_UNSPECIFIED MutateManifestWorkRequest_Type = 0 + // ROLLOUT is the type of the mutation for the rollout. + MutateManifestWorkRequest_ROLLOUT MutateManifestWorkRequest_Type = 1 + // ROLLBACK is the type of the mutation for the rollback. + MutateManifestWorkRequest_ROLLBACK MutateManifestWorkRequest_Type = 2 +) + +// Enum value maps for MutateManifestWorkRequest_Type. +var ( + MutateManifestWorkRequest_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "ROLLOUT", + 2: "ROLLBACK", + } + MutateManifestWorkRequest_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "ROLLOUT": 1, + "ROLLBACK": 2, + } +) + +func (x MutateManifestWorkRequest_Type) Enum() *MutateManifestWorkRequest_Type { + p := new(MutateManifestWorkRequest_Type) + *p = x + return p +} + +func (x MutateManifestWorkRequest_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MutateManifestWorkRequest_Type) Descriptor() protoreflect.EnumDescriptor { + return file_rollout_proto_enumTypes[2].Descriptor() +} + +func (MutateManifestWorkRequest_Type) Type() protoreflect.EnumType { + return &file_rollout_proto_enumTypes[2] +} + +func (x MutateManifestWorkRequest_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MutateManifestWorkRequest_Type.Descriptor instead. +func (MutateManifestWorkRequest_Type) EnumDescriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{8, 0} +} + +// InitPluginRequest is the request to initialize the plugin. +type InitPluginRequest 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 *InitPluginRequest) Reset() { + *x = InitPluginRequest{} + mi := &file_rollout_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitPluginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitPluginRequest) ProtoMessage() {} + +func (x *InitPluginRequest) 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 InitPluginRequest.ProtoReflect.Descriptor instead. +func (*InitPluginRequest) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{0} +} + +func (x *InitPluginRequest) GetOcmVersion() string { + if x != nil { + return x.OcmVersion + } + return "" +} + +// InitPluginResponse is the response from the plugin after initialization. +// The plugin returns the name, version, and capabilities of the plugin. +type InitPluginResponse 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 *InitPluginResponse_Capabilities `protobuf:"bytes,3,opt,name=capabilities,proto3" json:"capabilities,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InitPluginResponse) Reset() { + *x = InitPluginResponse{} + mi := &file_rollout_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitPluginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitPluginResponse) ProtoMessage() {} + +func (x *InitPluginResponse) 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 InitPluginResponse.ProtoReflect.Descriptor instead. +func (*InitPluginResponse) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{1} +} + +func (x *InitPluginResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *InitPluginResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *InitPluginResponse) GetCapabilities() *InitPluginResponse_Capabilities { + if x != nil { + return x.Capabilities + } + return nil +} + +// ClusterRolloutStatus is the status of the cluster rollout. +type ClusterRolloutStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + // name is the name of the cluster. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // rollout_status is the status of the cluster rollout. + 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) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClusterRolloutStatus) GetRolloutStatus() string { + if x != nil { + return x.RolloutStatus + } + return "" +} + +// RolloutDetails is the details of the rollout. +type RolloutDetails struct { + state protoimpl.MessageState `protogen:"open.v1"` + // completed is the clusters that have been completed. + Completed []*ClusterRolloutStatus `protobuf:"bytes,1,rep,name=completed,proto3" json:"completed,omitempty"` + // in_progress is the clusters that are currently being rolled out. + InProgress []*ClusterRolloutStatus `protobuf:"bytes,2,rep,name=in_progress,json=inProgress,proto3" json:"in_progress,omitempty"` + // timed_out is the clusters that have timed out. + TimedOut []*ClusterRolloutStatus `protobuf:"bytes,3,rep,name=timed_out,json=timedOut,proto3" json:"timed_out,omitempty"` + // removed is the clusters that have been removed. + Removed []*ClusterRolloutStatus `protobuf:"bytes,4,rep,name=removed,proto3" json:"removed,omitempty"` + // placement_total_clusters is the total clusters in 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 *RolloutDetails) Reset() { + *x = RolloutDetails{} + mi := &file_rollout_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RolloutDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RolloutDetails) ProtoMessage() {} + +func (x *RolloutDetails) 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 RolloutDetails.ProtoReflect.Descriptor instead. +func (*RolloutDetails) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{3} +} + +func (x *RolloutDetails) GetCompleted() []*ClusterRolloutStatus { + if x != nil { + return x.Completed + } + return nil +} + +func (x *RolloutDetails) GetInProgress() []*ClusterRolloutStatus { + if x != nil { + return x.InProgress + } + return nil +} + +func (x *RolloutDetails) GetTimedOut() []*ClusterRolloutStatus { + if x != nil { + return x.TimedOut + } + return nil +} + +func (x *RolloutDetails) GetRemoved() []*ClusterRolloutStatus { + if x != nil { + return x.Removed + } + return nil +} + +func (x *RolloutDetails) GetPlacementTotalClusters() int32 { + if x != nil { + return x.PlacementTotalClusters + } + return 0 +} + +type RolloutMeta 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 mwrs and placement are located. + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + // cluster_name is the name of the cluster. + 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 *RolloutMeta) Reset() { + *x = RolloutMeta{} + mi := &file_rollout_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RolloutMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RolloutMeta) ProtoMessage() {} + +func (x *RolloutMeta) 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 RolloutMeta.ProtoReflect.Descriptor instead. +func (*RolloutMeta) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{4} +} + +func (x *RolloutMeta) GetMwrsName() string { + if x != nil { + return x.MwrsName + } + return "" +} + +func (x *RolloutMeta) GetPlacementName() string { + if x != nil { + return x.PlacementName + } + return "" +} + +func (x *RolloutMeta) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *RolloutMeta) 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 *RolloutMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // rollout_details is the details of the rollout. + RolloutDetails *RolloutDetails `protobuf:"bytes,7,opt,name=rollout_details,json=rolloutDetails,proto3,oneof" json:"rollout_details,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() *RolloutMeta { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *RolloutPluginRequest) GetRolloutDetails() *RolloutDetails { + if x != nil { + return x.RolloutDetails + } + return nil +} + +// RolloutPluginResponse is the response from the plugin. +type RolloutPluginResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // result is the result of the response. + Result RolloutPluginResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse_Result" json:"result,omitempty"` + // Types that are valid to be assigned to Data: + // + // *RolloutPluginResponse_TextData + // *RolloutPluginResponse_ProtoData + Data isRolloutPluginResponse_Data `protobuf_oneof:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RolloutPluginResponse) Reset() { + *x = RolloutPluginResponse{} + mi := &file_rollout_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RolloutPluginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RolloutPluginResponse) ProtoMessage() {} + +func (x *RolloutPluginResponse) 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 RolloutPluginResponse.ProtoReflect.Descriptor instead. +func (*RolloutPluginResponse) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{6} +} + +func (x *RolloutPluginResponse) GetResult() RolloutPluginResponse_Result { + if x != nil { + return x.Result + } + return RolloutPluginResponse_RESULT_UNSPECIFIED +} + +func (x *RolloutPluginResponse) GetData() isRolloutPluginResponse_Data { + if x != nil { + return x.Data + } + return nil +} + +func (x *RolloutPluginResponse) GetTextData() string { + if x != nil { + if x, ok := x.Data.(*RolloutPluginResponse_TextData); ok { + return x.TextData + } + } + return "" +} + +func (x *RolloutPluginResponse) GetProtoData() *anypb.Any { + if x != nil { + if x, ok := x.Data.(*RolloutPluginResponse_ProtoData); ok { + return x.ProtoData + } + } + return nil +} + +type isRolloutPluginResponse_Data interface { + isRolloutPluginResponse_Data() +} + +type RolloutPluginResponse_TextData struct { + // text_data is the text data of the response. + TextData string `protobuf:"bytes,2,opt,name=text_data,json=textData,proto3,oneof"` +} + +type RolloutPluginResponse_ProtoData struct { + // proto_data is the protobuf data of the response. + ProtoData *anypb.Any `protobuf:"bytes,3,opt,name=proto_data,json=protoData,proto3,oneof"` +} + +func (*RolloutPluginResponse_TextData) isRolloutPluginResponse_Data() {} + +func (*RolloutPluginResponse_ProtoData) isRolloutPluginResponse_Data() {} + +// ValidateRolloutResponse is the response from the plugin for the validation of the rollout. +type ValidateRolloutResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // result is the result of the response. + Result ValidateRolloutResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse_Result" json:"result,omitempty"` + // Types that are valid to be assigned to Data: + // + // *ValidateRolloutResponse_TextData + // *ValidateRolloutResponse_ProtoData + Data isValidateRolloutResponse_Data `protobuf_oneof:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateRolloutResponse) Reset() { + *x = ValidateRolloutResponse{} + mi := &file_rollout_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateRolloutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateRolloutResponse) ProtoMessage() {} + +func (x *ValidateRolloutResponse) 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 ValidateRolloutResponse.ProtoReflect.Descriptor instead. +func (*ValidateRolloutResponse) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{7} +} + +func (x *ValidateRolloutResponse) GetResult() ValidateRolloutResponse_Result { + if x != nil { + return x.Result + } + return ValidateRolloutResponse_RESULT_UNSPECIFIED +} + +func (x *ValidateRolloutResponse) GetData() isValidateRolloutResponse_Data { + if x != nil { + return x.Data + } + return nil +} + +func (x *ValidateRolloutResponse) GetTextData() string { + if x != nil { + if x, ok := x.Data.(*ValidateRolloutResponse_TextData); ok { + return x.TextData + } + } + return "" +} + +func (x *ValidateRolloutResponse) GetProtoData() *anypb.Any { + if x != nil { + if x, ok := x.Data.(*ValidateRolloutResponse_ProtoData); ok { + return x.ProtoData + } + } + return nil +} + +type isValidateRolloutResponse_Data interface { + isValidateRolloutResponse_Data() +} + +type ValidateRolloutResponse_TextData struct { + // text_data is the text data of the response. + TextData string `protobuf:"bytes,2,opt,name=text_data,json=textData,proto3,oneof"` +} + +type ValidateRolloutResponse_ProtoData struct { + // proto_data is the protobuf data of the response. + ProtoData *anypb.Any `protobuf:"bytes,3,opt,name=proto_data,json=protoData,proto3,oneof"` +} + +func (*ValidateRolloutResponse_TextData) isValidateRolloutResponse_Data() {} + +func (*ValidateRolloutResponse_ProtoData) isValidateRolloutResponse_Data() {} + +// MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied. +type MutateManifestWorkRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // type is the type of the mutation. + Type MutateManifestWorkRequest_Type `protobuf:"varint,1,opt,name=type,proto3,enum=io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest_Type" json:"type,omitempty"` + // metadata is the metadata of the rollout. + Metadata *RolloutMeta `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + // rollout_details is the details of the rollout. + RolloutDetails *RolloutDetails `protobuf:"bytes,3,opt,name=rollout_details,json=rolloutDetails,proto3,oneof" json:"rollout_details,omitempty"` + // manifestwork is the unstructured manifestwork resource. + Manifestwork *RuntimeObject `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) GetType() MutateManifestWorkRequest_Type { + if x != nil { + return x.Type + } + return MutateManifestWorkRequest_TYPE_UNSPECIFIED +} + +func (x *MutateManifestWorkRequest) GetMetadata() *RolloutMeta { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *MutateManifestWorkRequest) GetRolloutDetails() *RolloutDetails { + if x != nil { + return x.RolloutDetails + } + return nil +} + +func (x *MutateManifestWorkRequest) GetManifestwork() *RuntimeObject { + if x != nil { + return x.Manifestwork + } + return nil +} + +// MutateManifestWorkResponse is the response to mutate the manifestwork resource before it is applied. +type MutateManifestWorkResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // manifestwork is the mutated manifestwork resource. + Manifestwork *RuntimeObject `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() *RuntimeObject { + if x != nil { + return x.Manifestwork + } + return nil +} + +// TypeMeta is the type meta of the kubernetes runtime object. +type TypeMeta struct { + state protoimpl.MessageState `protogen:"open.v1"` + ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TypeMeta) Reset() { + *x = TypeMeta{} + mi := &file_rollout_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TypeMeta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypeMeta) ProtoMessage() {} + +func (x *TypeMeta) 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 TypeMeta.ProtoReflect.Descriptor instead. +func (*TypeMeta) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{10} +} + +func (x *TypeMeta) GetApiVersion() string { + if x != nil { + return x.ApiVersion + } + return "" +} + +func (x *TypeMeta) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +// RuntimeObject is the kubernetes runtime object. +type RuntimeObject struct { + state protoimpl.MessageState `protogen:"open.v1"` + TypeMeta *TypeMeta `protobuf:"bytes,1,opt,name=type_meta,json=typeMeta,proto3" json:"type_meta,omitempty"` + // Raw will hold the complete serialized object which couldn't be matched + // with a registered type. Most likely, nothing should be done with this + // except for passing it through the system. + Raw []byte `protobuf:"bytes,2,opt,name=raw,proto3" json:"raw,omitempty"` + // ContentType is serialization method used to serialize 'Raw'. + // Unspecified means ContentTypeJSON. + ContentType string `protobuf:"bytes,3,opt,name=contentType,proto3" json:"contentType,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RuntimeObject) Reset() { + *x = RuntimeObject{} + mi := &file_rollout_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RuntimeObject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RuntimeObject) ProtoMessage() {} + +func (x *RuntimeObject) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[11] + 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 RuntimeObject.ProtoReflect.Descriptor instead. +func (*RuntimeObject) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{11} +} + +func (x *RuntimeObject) GetTypeMeta() *TypeMeta { + if x != nil { + return x.TypeMeta + } + return nil +} + +func (x *RuntimeObject) GetRaw() []byte { + if x != nil { + return x.Raw + } + return nil +} + +func (x *RuntimeObject) GetContentType() string { + if x != nil { + return x.ContentType + } + return "" +} + +type InitPluginResponse_Capabilities struct { + state protoimpl.MessageState `protogen:"open.v1"` + // rollout is the capability to rollout. + Rollout bool `protobuf:"varint,1,opt,name=rollout,proto3" json:"rollout,omitempty"` + // rollback is the capability to rollback. + Rollback bool `protobuf:"varint,2,opt,name=rollback,proto3" json:"rollback,omitempty"` + // mutate_manifestwork is the capability to 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 *InitPluginResponse_Capabilities) Reset() { + *x = InitPluginResponse_Capabilities{} + mi := &file_rollout_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitPluginResponse_Capabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitPluginResponse_Capabilities) ProtoMessage() {} + +func (x *InitPluginResponse_Capabilities) ProtoReflect() protoreflect.Message { + mi := &file_rollout_proto_msgTypes[12] + 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 InitPluginResponse_Capabilities.ProtoReflect.Descriptor instead. +func (*InitPluginResponse_Capabilities) Descriptor() ([]byte, []int) { + return file_rollout_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *InitPluginResponse_Capabilities) GetRollout() bool { + if x != nil { + return x.Rollout + } + return false +} + +func (x *InitPluginResponse_Capabilities) GetRollback() bool { + if x != nil { + return x.Rollback + } + return false +} + +func (x *InitPluginResponse_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\x12%io.openclustermanagement.sdkgo.plugin\x1a\x19google/protobuf/any.proto\"4\n" + + "\x11InitPluginRequest\x12\x1f\n" + + "\vocm_version\x18\x01 \x01(\tR\n" + + "ocmVersion\"\xa5\x02\n" + + "\x12InitPluginResponse\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12j\n" + + "\fcapabilities\x18\x03 \x01(\v2F.io.openclustermanagement.sdkgo.plugin.InitPluginResponse.CapabilitiesR\fcapabilities\x1au\n" + + "\fCapabilities\x12\x18\n" + + "\arollout\x18\x01 \x01(\bR\arollout\x12\x1a\n" + + "\brollback\x18\x02 \x01(\bR\brollback\x12/\n" + + "\x13mutate_manifestwork\x18\x03 \x01(\bR\x12mutateManifestwork\"Q\n" + + "\x14ClusterRolloutStatus\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12%\n" + + "\x0erollout_status\x18\x02 \x01(\tR\rrolloutStatus\"\xb4\x03\n" + + "\x0eRolloutDetails\x12Y\n" + + "\tcompleted\x18\x01 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\tcompleted\x12\\\n" + + "\vin_progress\x18\x02 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\n" + + "inProgress\x12X\n" + + "\ttimed_out\x18\x03 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\btimedOut\x12U\n" + + "\aremoved\x18\x04 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\aremoved\x128\n" + + "\x18placement_total_clusters\x18\x06 \x01(\x05R\x16placementTotalClusters\"\xa8\x01\n" + + "\vRolloutMeta\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\"\xdf\x01\n" + + "\x14RolloutPluginRequest\x12N\n" + + "\bmetadata\x18\x01 \x01(\v22.io.openclustermanagement.sdkgo.plugin.RolloutMetaR\bmetadata\x12c\n" + + "\x0frollout_details\x18\a \x01(\v25.io.openclustermanagement.sdkgo.plugin.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01B\x12\n" + + "\x10_rollout_details\"\x88\x02\n" + + "\x15RolloutPluginResponse\x12[\n" + + "\x06result\x18\x01 \x01(\x0e2C.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.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\"4\n" + + "\x06Result\x12\x16\n" + + "\x12RESULT_UNSPECIFIED\x10\x00\x12\x06\n" + + "\x02OK\x10\x01\x12\n" + + "\n" + + "\x06FAILED\x10\x02B\x06\n" + + "\x04data\"\xa3\x02\n" + + "\x17ValidateRolloutResponse\x12]\n" + + "\x06result\x18\x01 \x01(\x0e2E.io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.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\"\xd2\x03\n" + + "\x19MutateManifestWorkRequest\x12Y\n" + + "\x04type\x18\x01 \x01(\x0e2E.io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.TypeR\x04type\x12N\n" + + "\bmetadata\x18\x02 \x01(\v22.io.openclustermanagement.sdkgo.plugin.RolloutMetaR\bmetadata\x12c\n" + + "\x0frollout_details\x18\x03 \x01(\v25.io.openclustermanagement.sdkgo.plugin.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01\x12X\n" + + "\fmanifestwork\x18\x04 \x01(\v24.io.openclustermanagement.sdkgo.plugin.RuntimeObjectR\fmanifestwork\"7\n" + + "\x04Type\x12\x14\n" + + "\x10TYPE_UNSPECIFIED\x10\x00\x12\v\n" + + "\aROLLOUT\x10\x01\x12\f\n" + + "\bROLLBACK\x10\x02B\x12\n" + + "\x10_rollout_details\"v\n" + + "\x1aMutateManifestWorkResponse\x12X\n" + + "\fmanifestwork\x18\x01 \x01(\v24.io.openclustermanagement.sdkgo.plugin.RuntimeObjectR\fmanifestwork\"?\n" + + "\bTypeMeta\x12\x1f\n" + + "\vapi_version\x18\x01 \x01(\tR\n" + + "apiVersion\x12\x12\n" + + "\x04kind\x18\x02 \x01(\tR\x04kind\"\x91\x01\n" + + "\rRuntimeObject\x12L\n" + + "\ttype_meta\x18\x01 \x01(\v2/.io.openclustermanagement.sdkgo.plugin.TypeMetaR\btypeMeta\x12\x10\n" + + "\x03raw\x18\x02 \x01(\fR\x03raw\x12 \n" + + "\vcontentType\x18\x03 \x01(\tR\vcontentType2\x91\t\n" + + "\x14RolloutPluginService\x12\x81\x01\n" + + "\n" + + "InitPlugin\x128.io.openclustermanagement.sdkgo.plugin.InitPluginRequest\x1a9.io.openclustermanagement.sdkgo.plugin.InitPluginResponse\x12\x89\x01\n" + + "\fBeginRollout\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8c\x01\n" + + "\x0fProgressRollout\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8e\x01\n" + + "\x0fValidateRollout\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a>.io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse\x12\x8a\x01\n" + + "\rBeginRollback\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8d\x01\n" + + "\x10ProgressRollback\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8f\x01\n" + + "\x10ValidateRollback\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a>.io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse\x12\x99\x01\n" + + "\x12MutateManifestWork\x12@.io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest\x1aA.io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponseB1Z/open-cluster-management.io/sdk-go/plugin;pluginb\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, 3) +var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_rollout_proto_goTypes = []any{ + (RolloutPluginResponse_Result)(0), // 0: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.Result + (ValidateRolloutResponse_Result)(0), // 1: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.Result + (MutateManifestWorkRequest_Type)(0), // 2: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.Type + (*InitPluginRequest)(nil), // 3: io.openclustermanagement.sdkgo.plugin.InitPluginRequest + (*InitPluginResponse)(nil), // 4: io.openclustermanagement.sdkgo.plugin.InitPluginResponse + (*ClusterRolloutStatus)(nil), // 5: io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus + (*RolloutDetails)(nil), // 6: io.openclustermanagement.sdkgo.plugin.RolloutDetails + (*RolloutMeta)(nil), // 7: io.openclustermanagement.sdkgo.plugin.RolloutMeta + (*RolloutPluginRequest)(nil), // 8: io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest + (*RolloutPluginResponse)(nil), // 9: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse + (*ValidateRolloutResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse + (*MutateManifestWorkRequest)(nil), // 11: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest + (*MutateManifestWorkResponse)(nil), // 12: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponse + (*TypeMeta)(nil), // 13: io.openclustermanagement.sdkgo.plugin.TypeMeta + (*RuntimeObject)(nil), // 14: io.openclustermanagement.sdkgo.plugin.RuntimeObject + (*InitPluginResponse_Capabilities)(nil), // 15: io.openclustermanagement.sdkgo.plugin.InitPluginResponse.Capabilities + (*anypb.Any)(nil), // 16: google.protobuf.Any +} +var file_rollout_proto_depIdxs = []int32{ + 15, // 0: io.openclustermanagement.sdkgo.plugin.InitPluginResponse.capabilities:type_name -> io.openclustermanagement.sdkgo.plugin.InitPluginResponse.Capabilities + 5, // 1: io.openclustermanagement.sdkgo.plugin.RolloutDetails.completed:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus + 5, // 2: io.openclustermanagement.sdkgo.plugin.RolloutDetails.in_progress:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus + 5, // 3: io.openclustermanagement.sdkgo.plugin.RolloutDetails.timed_out:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus + 5, // 4: io.openclustermanagement.sdkgo.plugin.RolloutDetails.removed:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus + 7, // 5: io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutMeta + 6, // 6: io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutDetails + 0, // 7: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.Result + 16, // 8: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.proto_data:type_name -> google.protobuf.Any + 1, // 9: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.Result + 16, // 10: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.proto_data:type_name -> google.protobuf.Any + 2, // 11: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.type:type_name -> io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.Type + 7, // 12: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutMeta + 6, // 13: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutDetails + 14, // 14: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.manifestwork:type_name -> io.openclustermanagement.sdkgo.plugin.RuntimeObject + 14, // 15: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponse.manifestwork:type_name -> io.openclustermanagement.sdkgo.plugin.RuntimeObject + 13, // 16: io.openclustermanagement.sdkgo.plugin.RuntimeObject.type_meta:type_name -> io.openclustermanagement.sdkgo.plugin.TypeMeta + 3, // 17: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.InitPlugin:input_type -> io.openclustermanagement.sdkgo.plugin.InitPluginRequest + 8, // 18: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest + 8, // 19: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest + 8, // 20: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollout:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest + 8, // 21: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest + 8, // 22: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest + 8, // 23: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollback:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest + 11, // 24: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest + 4, // 25: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.InitPlugin:output_type -> io.openclustermanagement.sdkgo.plugin.InitPluginResponse + 9, // 26: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollout:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse + 9, // 27: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollout:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse + 10, // 28: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse + 9, // 29: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollback:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse + 9, // 30: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollback:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse + 10, // 31: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse + 12, // 32: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponse + 25, // [25:33] is the sub-list for method output_type + 17, // [17:25] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] 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[6].OneofWrappers = []any{ + (*RolloutPluginResponse_TextData)(nil), + (*RolloutPluginResponse_ProtoData)(nil), + } + file_rollout_proto_msgTypes[7].OneofWrappers = []any{ + (*ValidateRolloutResponse_TextData)(nil), + (*ValidateRolloutResponse_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: 3, + NumMessages: 13, + 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/rollout.proto b/pkg/plugin/rollout.proto index 5fe32abe..07a0d32b 100644 --- a/pkg/plugin/rollout.proto +++ b/pkg/plugin/rollout.proto @@ -1,10 +1,17 @@ +// 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 open-cluster-management.io.sdk-go.plugin; +package io.openclustermanagement.sdkgo.plugin; -import "google/protobuf/struct.proto"; +// import "google/protobuf/struct.proto"; +// import "k8s.io/apimachinery/pkg/runtime/generated.proto"; +// import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; +import "google/protobuf/any.proto"; -option go_package = "open-cluster-management.io/sdk-go/pkg/plugin;plugin"; +option go_package = "open-cluster-management.io/sdk-go/plugin;plugin"; // RolloutPluginService is the service for the rollout plugin. service RolloutPluginService { @@ -14,7 +21,7 @@ service RolloutPluginService { // BeginRollout is called before the manifestwork resource is applied. // It is used to prepare the rollout. rpc BeginRollout(RolloutPluginRequest) returns (RolloutPluginResponse); - + // 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. @@ -55,7 +62,8 @@ message InitPluginRequest { string ocm_version = 1; } -// InitPluginResponse is the response to initialize the plugin. +// InitPluginResponse is the response from the plugin after initialization. +// The plugin returns the name, version, and capabilities of the plugin. message InitPluginResponse { // name is the name of the plugin. string name = 1; @@ -88,9 +96,6 @@ message ClusterRolloutStatus { // RolloutDetails is the details of the rollout. message RolloutDetails { - // placement_total_clusters is the total clusters in placement decision. - int32 placement_total_clusters = 1; - // completed is the clusters that have been completed. repeated ClusterRolloutStatus completed = 1; @@ -102,6 +107,9 @@ message RolloutDetails { // removed is the clusters that have been removed. repeated ClusterRolloutStatus removed = 4; + + // placement_total_clusters is the total clusters in placement decision. + int32 placement_total_clusters = 6; } message RolloutMeta { @@ -142,9 +150,14 @@ message RolloutPluginResponse { // result is the result of the response. Result result = 1; - - // details is the message of the response. - optional string details = 2; + + oneof data { + // text_data is the text data of the response. + string text_data = 2; + + // proto_data is the protobuf data of the response. + google.protobuf.Any proto_data = 3; + } } // ValidateRolloutResponse is the response from the plugin for the validation of the rollout. @@ -154,22 +167,29 @@ message ValidateRolloutResponse { // RESULT_UNSPECIFIED is the unspecified result. RESULT_UNSPECIFIED = 0; - // OK is the ok result. - OK = 1; - - // FAILED is the failed result. + // 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 the rollback is required. FAILED = 2; - // INPROGRESS is the state where the validation is still in progress. - // MWRS Controller will keep calling this method until the result is not INPROGRESS. + // 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 result of the response. Result result = 1; - // details is the message of the response. - optional string details = 2; + oneof data { + // text_data is the text data of the response. + string text_data = 2; + + // proto_data is the protobuf data of the response. + google.protobuf.Any proto_data = 3; + } } // MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied. diff --git a/pkg/plugin/rollout_grpc.pb.go b/pkg/plugin/rollout_grpc.pb.go new file mode 100644 index 00000000..79543d45 --- /dev/null +++ b/pkg/plugin/rollout_grpc.pb.go @@ -0,0 +1,443 @@ +// 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 plugin + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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_InitPlugin_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/InitPlugin" + RolloutPluginService_BeginRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/BeginRollout" + RolloutPluginService_ProgressRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ProgressRollout" + RolloutPluginService_ValidateRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ValidateRollout" + RolloutPluginService_BeginRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/BeginRollback" + RolloutPluginService_ProgressRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ProgressRollback" + RolloutPluginService_ValidateRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ValidateRollback" + RolloutPluginService_MutateManifestWork_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.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 { + // InitPlugin initializes the plugin + InitPlugin(ctx context.Context, in *InitPluginRequest, opts ...grpc.CallOption) (*InitPluginResponse, 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) (*RolloutPluginResponse, 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) (*RolloutPluginResponse, error) + // ValidateRollout 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 OK result. + // If the validation is still in progress, the plugin should return a INPROGRESS result. + // If the validation is failed, the plugin should return a FAILED result. + ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) + // BeginRollback is called before the manifestwork resource is rolled back. + // It is used to prepare the rollback. + BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) + // ProgressRollback is called after the manifestwork is rolled back. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the rollback logic based on the feedback status changes. + ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) + // ValidateRollback is called to validate the completion of the rollback. + // It is used to check if the rollback is completed successfully. + // If the validation is completed successfully, the plugin should return a OK result. + // If the validation is still in progress, the plugin should return a INPROGRESS result. + // If the validation is failed, the plugin should return a FAILED result. + ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) + // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. + // 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) InitPlugin(ctx context.Context, in *InitPluginRequest, opts ...grpc.CallOption) (*InitPluginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InitPluginResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_InitPlugin_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) (*RolloutPluginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RolloutPluginResponse) + 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) (*RolloutPluginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RolloutPluginResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_ProgressRollout_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValidateRolloutResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRollout_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RolloutPluginResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_BeginRollback_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RolloutPluginResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_ProgressRollback_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rolloutPluginServiceClient) ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValidateRolloutResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRollback_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 { + // InitPlugin initializes the plugin + InitPlugin(context.Context, *InitPluginRequest) (*InitPluginResponse, error) + // BeginRollout is called before the manifestwork resource is applied. + // It is used to prepare the rollout. + BeginRollout(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, 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) (*RolloutPluginResponse, error) + // ValidateRollout 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 OK result. + // If the validation is still in progress, the plugin should return a INPROGRESS result. + // If the validation is failed, the plugin should return a FAILED result. + ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) + // BeginRollback is called before the manifestwork resource is rolled back. + // It is used to prepare the rollback. + BeginRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) + // ProgressRollback is called after the manifestwork is rolled back. + // Whenever the feedbacks are updated, this method will be called. + // The plugin can execute the rollback logic based on the feedback status changes. + ProgressRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) + // ValidateRollback is called to validate the completion of the rollback. + // It is used to check if the rollback is completed successfully. + // If the validation is completed successfully, the plugin should return a OK result. + // If the validation is still in progress, the plugin should return a INPROGRESS result. + // If the validation is failed, the plugin should return a FAILED result. + ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) + // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. + // 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) InitPlugin(context.Context, *InitPluginRequest) (*InitPluginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitPlugin not implemented") +} +func (UnimplementedRolloutPluginServiceServer) BeginRollout(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginRollout not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ProgressRollout(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProgressRollout not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateRollout not implemented") +} +func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginRollback not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ProgressRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProgressRollback not implemented") +} +func (UnimplementedRolloutPluginServiceServer) ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateRollback 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_InitPlugin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitPluginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RolloutPluginServiceServer).InitPlugin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_InitPlugin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).InitPlugin(ctx, req.(*InitPluginRequest)) + } + 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_ValidateRollout_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).ValidateRollout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_ValidateRollout_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).ValidateRollout(ctx, req.(*RolloutPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_BeginRollback_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).BeginRollback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_BeginRollback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).BeginRollback(ctx, req.(*RolloutPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_ProgressRollback_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).ProgressRollback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_ProgressRollback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).ProgressRollback(ctx, req.(*RolloutPluginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RolloutPluginService_ValidateRollback_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).ValidateRollback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RolloutPluginService_ValidateRollback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RolloutPluginServiceServer).ValidateRollback(ctx, req.(*RolloutPluginRequest)) + } + 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.RolloutPluginService", + HandlerType: (*RolloutPluginServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "InitPlugin", + Handler: _RolloutPluginService_InitPlugin_Handler, + }, + { + MethodName: "BeginRollout", + Handler: _RolloutPluginService_BeginRollout_Handler, + }, + { + MethodName: "ProgressRollout", + Handler: _RolloutPluginService_ProgressRollout_Handler, + }, + { + MethodName: "ValidateRollout", + Handler: _RolloutPluginService_ValidateRollout_Handler, + }, + { + MethodName: "BeginRollback", + Handler: _RolloutPluginService_BeginRollback_Handler, + }, + { + MethodName: "ProgressRollback", + Handler: _RolloutPluginService_ProgressRollback_Handler, + }, + { + MethodName: "ValidateRollback", + Handler: _RolloutPluginService_ValidateRollback_Handler, + }, + { + MethodName: "MutateManifestWork", + Handler: _RolloutPluginService_MutateManifestWork_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "rollout.proto", +} From 8fba8c0982401c2dfa645421d83419e5638f1b41 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Sat, 25 Oct 2025 06:41:01 -0700 Subject: [PATCH 3/9] revised --- pkg/plugin/{ => proto/v1alpha1}/gen.go | 4 +- pkg/plugin/{ => proto/v1alpha1}/rollout.pb.go | 465 +++++++----------- pkg/plugin/{ => proto/v1alpha1}/rollout.proto | 60 +-- .../{ => proto/v1alpha1}/rollout_grpc.pb.go | 52 +- 4 files changed, 216 insertions(+), 365 deletions(-) rename pkg/plugin/{ => proto/v1alpha1}/gen.go (57%) rename pkg/plugin/{ => proto/v1alpha1}/rollout.pb.go (59%) rename pkg/plugin/{ => proto/v1alpha1}/rollout.proto (82%) rename pkg/plugin/{ => proto/v1alpha1}/rollout_grpc.pb.go (90%) diff --git a/pkg/plugin/gen.go b/pkg/plugin/proto/v1alpha1/gen.go similarity index 57% rename from pkg/plugin/gen.go rename to pkg/plugin/proto/v1alpha1/gen.go index 018f9ba6..303b45b0 100644 --- a/pkg/plugin/gen.go +++ b/pkg/plugin/proto/v1alpha1/gen.go @@ -1,6 +1,6 @@ -package plugin +package v1alpha1 -//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative rollout.proto +//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. // diff --git a/pkg/plugin/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go similarity index 59% rename from pkg/plugin/rollout.pb.go rename to pkg/plugin/proto/v1alpha1/rollout.pb.go index cd9c0630..2e7498dd 100644 --- a/pkg/plugin/rollout.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -8,12 +8,13 @@ // protoc v6.33.0 // source: rollout.proto -package plugin +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" + runtime "k8s.io/apimachinery/pkg/runtime" reflect "reflect" sync "sync" unsafe "unsafe" @@ -138,59 +139,59 @@ func (ValidateRolloutResponse_Result) EnumDescriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{7, 0} } -type MutateManifestWorkRequest_Type int32 +type MutateManifestWorkRequest_RolloutState int32 const ( - MutateManifestWorkRequest_TYPE_UNSPECIFIED MutateManifestWorkRequest_Type = 0 - // ROLLOUT is the type of the mutation for the rollout. - MutateManifestWorkRequest_ROLLOUT MutateManifestWorkRequest_Type = 1 - // ROLLBACK is the type of the mutation for the rollback. - MutateManifestWorkRequest_ROLLBACK MutateManifestWorkRequest_Type = 2 + MutateManifestWorkRequest_ROLLOUT_STATE_UNSPECIFIED MutateManifestWorkRequest_RolloutState = 0 + // ROLLOUT is the rollout state for the rollout. + MutateManifestWorkRequest_ROLLOUT MutateManifestWorkRequest_RolloutState = 1 + // ROLLBACK is the rollout state for the rollback. + MutateManifestWorkRequest_ROLLBACK MutateManifestWorkRequest_RolloutState = 2 ) -// Enum value maps for MutateManifestWorkRequest_Type. +// Enum value maps for MutateManifestWorkRequest_RolloutState. var ( - MutateManifestWorkRequest_Type_name = map[int32]string{ - 0: "TYPE_UNSPECIFIED", + MutateManifestWorkRequest_RolloutState_name = map[int32]string{ + 0: "ROLLOUT_STATE_UNSPECIFIED", 1: "ROLLOUT", 2: "ROLLBACK", } - MutateManifestWorkRequest_Type_value = map[string]int32{ - "TYPE_UNSPECIFIED": 0, - "ROLLOUT": 1, - "ROLLBACK": 2, + MutateManifestWorkRequest_RolloutState_value = map[string]int32{ + "ROLLOUT_STATE_UNSPECIFIED": 0, + "ROLLOUT": 1, + "ROLLBACK": 2, } ) -func (x MutateManifestWorkRequest_Type) Enum() *MutateManifestWorkRequest_Type { - p := new(MutateManifestWorkRequest_Type) +func (x MutateManifestWorkRequest_RolloutState) Enum() *MutateManifestWorkRequest_RolloutState { + p := new(MutateManifestWorkRequest_RolloutState) *p = x return p } -func (x MutateManifestWorkRequest_Type) String() string { +func (x MutateManifestWorkRequest_RolloutState) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (MutateManifestWorkRequest_Type) Descriptor() protoreflect.EnumDescriptor { +func (MutateManifestWorkRequest_RolloutState) Descriptor() protoreflect.EnumDescriptor { return file_rollout_proto_enumTypes[2].Descriptor() } -func (MutateManifestWorkRequest_Type) Type() protoreflect.EnumType { +func (MutateManifestWorkRequest_RolloutState) Type() protoreflect.EnumType { return &file_rollout_proto_enumTypes[2] } -func (x MutateManifestWorkRequest_Type) Number() protoreflect.EnumNumber { +func (x MutateManifestWorkRequest_RolloutState) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use MutateManifestWorkRequest_Type.Descriptor instead. -func (MutateManifestWorkRequest_Type) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use MutateManifestWorkRequest_RolloutState.Descriptor instead. +func (MutateManifestWorkRequest_RolloutState) EnumDescriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{8, 0} } -// InitPluginRequest is the request to initialize the plugin. -type InitPluginRequest struct { +// 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"` @@ -198,20 +199,20 @@ type InitPluginRequest struct { sizeCache protoimpl.SizeCache } -func (x *InitPluginRequest) Reset() { - *x = InitPluginRequest{} +func (x *InitializeRequest) Reset() { + *x = InitializeRequest{} mi := &file_rollout_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *InitPluginRequest) String() string { +func (x *InitializeRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*InitPluginRequest) ProtoMessage() {} +func (*InitializeRequest) ProtoMessage() {} -func (x *InitPluginRequest) ProtoReflect() protoreflect.Message { +func (x *InitializeRequest) ProtoReflect() protoreflect.Message { mi := &file_rollout_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -223,46 +224,46 @@ func (x *InitPluginRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use InitPluginRequest.ProtoReflect.Descriptor instead. -func (*InitPluginRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use InitializeRequest.ProtoReflect.Descriptor instead. +func (*InitializeRequest) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{0} } -func (x *InitPluginRequest) GetOcmVersion() string { +func (x *InitializeRequest) GetOcmVersion() string { if x != nil { return x.OcmVersion } return "" } -// InitPluginResponse is the response from the plugin after initialization. +// InitializeResponse is the response from the plugin after initialization. // The plugin returns the name, version, and capabilities of the plugin. -type InitPluginResponse struct { +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 *InitPluginResponse_Capabilities `protobuf:"bytes,3,opt,name=capabilities,proto3" json:"capabilities,omitempty"` + Capabilities *InitializeResponse_Capabilities `protobuf:"bytes,3,opt,name=capabilities,proto3" json:"capabilities,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *InitPluginResponse) Reset() { - *x = InitPluginResponse{} +func (x *InitializeResponse) Reset() { + *x = InitializeResponse{} mi := &file_rollout_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *InitPluginResponse) String() string { +func (x *InitializeResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*InitPluginResponse) ProtoMessage() {} +func (*InitializeResponse) ProtoMessage() {} -func (x *InitPluginResponse) ProtoReflect() protoreflect.Message { +func (x *InitializeResponse) ProtoReflect() protoreflect.Message { mi := &file_rollout_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -274,26 +275,26 @@ func (x *InitPluginResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use InitPluginResponse.ProtoReflect.Descriptor instead. -func (*InitPluginResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use InitializeResponse.ProtoReflect.Descriptor instead. +func (*InitializeResponse) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{1} } -func (x *InitPluginResponse) GetName() string { +func (x *InitializeResponse) GetName() string { if x != nil { return x.Name } return "" } -func (x *InitPluginResponse) GetVersion() string { +func (x *InitializeResponse) GetVersion() string { if x != nil { return x.Version } return "" } -func (x *InitPluginResponse) GetCapabilities() *InitPluginResponse_Capabilities { +func (x *InitializeResponse) GetCapabilities() *InitializeResponse_Capabilities { if x != nil { return x.Capabilities } @@ -437,6 +438,7 @@ func (x *RolloutDetails) GetPlacementTotalClusters() int32 { return 0 } +// RolloutMeta is the metadata of the rollout. type RolloutMeta struct { state protoimpl.MessageState `protogen:"open.v1"` // mwrs_name is the name of the manifestwork resource set. @@ -568,7 +570,7 @@ func (x *RolloutPluginRequest) GetRolloutDetails() *RolloutDetails { type RolloutPluginResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // result is the result of the response. - Result RolloutPluginResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse_Result" json:"result,omitempty"` + Result RolloutPluginResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse_Result" json:"result,omitempty"` // Types that are valid to be assigned to Data: // // *RolloutPluginResponse_TextData @@ -662,7 +664,7 @@ func (*RolloutPluginResponse_ProtoData) isRolloutPluginResponse_Data() {} type ValidateRolloutResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // result is the result of the response. - Result ValidateRolloutResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse_Result" json:"result,omitempty"` + Result ValidateRolloutResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse_Result" json:"result,omitempty"` // Types that are valid to be assigned to Data: // // *ValidateRolloutResponse_TextData @@ -755,14 +757,14 @@ func (*ValidateRolloutResponse_ProtoData) isValidateRolloutResponse_Data() {} // MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied. type MutateManifestWorkRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // type is the type of the mutation. - Type MutateManifestWorkRequest_Type `protobuf:"varint,1,opt,name=type,proto3,enum=io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest_Type" json:"type,omitempty"` + // rollout_state is the rollout state. + 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 is the metadata of the rollout. Metadata *RolloutMeta `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // rollout_details is the details of the rollout. RolloutDetails *RolloutDetails `protobuf:"bytes,3,opt,name=rollout_details,json=rolloutDetails,proto3,oneof" json:"rollout_details,omitempty"` // manifestwork is the unstructured manifestwork resource. - Manifestwork *RuntimeObject `protobuf:"bytes,4,opt,name=manifestwork,proto3" json:"manifestwork,omitempty"` + Manifestwork *runtime.Unknown `protobuf:"bytes,4,opt,name=manifestwork,proto3" json:"manifestwork,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -797,11 +799,11 @@ func (*MutateManifestWorkRequest) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{8} } -func (x *MutateManifestWorkRequest) GetType() MutateManifestWorkRequest_Type { +func (x *MutateManifestWorkRequest) GetRolloutState() MutateManifestWorkRequest_RolloutState { if x != nil { - return x.Type + return x.RolloutState } - return MutateManifestWorkRequest_TYPE_UNSPECIFIED + return MutateManifestWorkRequest_ROLLOUT_STATE_UNSPECIFIED } func (x *MutateManifestWorkRequest) GetMetadata() *RolloutMeta { @@ -818,7 +820,7 @@ func (x *MutateManifestWorkRequest) GetRolloutDetails() *RolloutDetails { return nil } -func (x *MutateManifestWorkRequest) GetManifestwork() *RuntimeObject { +func (x *MutateManifestWorkRequest) GetManifestwork() *runtime.Unknown { if x != nil { return x.Manifestwork } @@ -829,7 +831,7 @@ func (x *MutateManifestWorkRequest) GetManifestwork() *RuntimeObject { type MutateManifestWorkResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // manifestwork is the mutated manifestwork resource. - Manifestwork *RuntimeObject `protobuf:"bytes,1,opt,name=manifestwork,proto3" json:"manifestwork,omitempty"` + Manifestwork *runtime.Unknown `protobuf:"bytes,1,opt,name=manifestwork,proto3" json:"manifestwork,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -864,133 +866,14 @@ func (*MutateManifestWorkResponse) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{9} } -func (x *MutateManifestWorkResponse) GetManifestwork() *RuntimeObject { +func (x *MutateManifestWorkResponse) GetManifestwork() *runtime.Unknown { if x != nil { return x.Manifestwork } return nil } -// TypeMeta is the type meta of the kubernetes runtime object. -type TypeMeta struct { - state protoimpl.MessageState `protogen:"open.v1"` - ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TypeMeta) Reset() { - *x = TypeMeta{} - mi := &file_rollout_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TypeMeta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TypeMeta) ProtoMessage() {} - -func (x *TypeMeta) 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 TypeMeta.ProtoReflect.Descriptor instead. -func (*TypeMeta) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{10} -} - -func (x *TypeMeta) GetApiVersion() string { - if x != nil { - return x.ApiVersion - } - return "" -} - -func (x *TypeMeta) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - -// RuntimeObject is the kubernetes runtime object. -type RuntimeObject struct { - state protoimpl.MessageState `protogen:"open.v1"` - TypeMeta *TypeMeta `protobuf:"bytes,1,opt,name=type_meta,json=typeMeta,proto3" json:"type_meta,omitempty"` - // Raw will hold the complete serialized object which couldn't be matched - // with a registered type. Most likely, nothing should be done with this - // except for passing it through the system. - Raw []byte `protobuf:"bytes,2,opt,name=raw,proto3" json:"raw,omitempty"` - // ContentType is serialization method used to serialize 'Raw'. - // Unspecified means ContentTypeJSON. - ContentType string `protobuf:"bytes,3,opt,name=contentType,proto3" json:"contentType,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RuntimeObject) Reset() { - *x = RuntimeObject{} - mi := &file_rollout_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RuntimeObject) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RuntimeObject) ProtoMessage() {} - -func (x *RuntimeObject) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[11] - 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 RuntimeObject.ProtoReflect.Descriptor instead. -func (*RuntimeObject) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{11} -} - -func (x *RuntimeObject) GetTypeMeta() *TypeMeta { - if x != nil { - return x.TypeMeta - } - return nil -} - -func (x *RuntimeObject) GetRaw() []byte { - if x != nil { - return x.Raw - } - return nil -} - -func (x *RuntimeObject) GetContentType() string { - if x != nil { - return x.ContentType - } - return "" -} - -type InitPluginResponse_Capabilities struct { +type InitializeResponse_Capabilities struct { state protoimpl.MessageState `protogen:"open.v1"` // rollout is the capability to rollout. Rollout bool `protobuf:"varint,1,opt,name=rollout,proto3" json:"rollout,omitempty"` @@ -1002,21 +885,21 @@ type InitPluginResponse_Capabilities struct { sizeCache protoimpl.SizeCache } -func (x *InitPluginResponse_Capabilities) Reset() { - *x = InitPluginResponse_Capabilities{} - mi := &file_rollout_proto_msgTypes[12] +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 *InitPluginResponse_Capabilities) String() string { +func (x *InitializeResponse_Capabilities) String() string { return protoimpl.X.MessageStringOf(x) } -func (*InitPluginResponse_Capabilities) ProtoMessage() {} +func (*InitializeResponse_Capabilities) ProtoMessage() {} -func (x *InitPluginResponse_Capabilities) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[12] +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 { @@ -1027,26 +910,26 @@ func (x *InitPluginResponse_Capabilities) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use InitPluginResponse_Capabilities.ProtoReflect.Descriptor instead. -func (*InitPluginResponse_Capabilities) Descriptor() ([]byte, []int) { +// Deprecated: Use InitializeResponse_Capabilities.ProtoReflect.Descriptor instead. +func (*InitializeResponse_Capabilities) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{1, 0} } -func (x *InitPluginResponse_Capabilities) GetRollout() bool { +func (x *InitializeResponse_Capabilities) GetRollout() bool { if x != nil { return x.Rollout } return false } -func (x *InitPluginResponse_Capabilities) GetRollback() bool { +func (x *InitializeResponse_Capabilities) GetRollback() bool { if x != nil { return x.Rollback } return false } -func (x *InitPluginResponse_Capabilities) GetMutateManifestwork() bool { +func (x *InitializeResponse_Capabilities) GetMutateManifestwork() bool { if x != nil { return x.MutateManifestwork } @@ -1057,40 +940,40 @@ var File_rollout_proto protoreflect.FileDescriptor const file_rollout_proto_rawDesc = "" + "\n" + - "\rrollout.proto\x12%io.openclustermanagement.sdkgo.plugin\x1a\x19google/protobuf/any.proto\"4\n" + - "\x11InitPluginRequest\x12\x1f\n" + + "\rrollout.proto\x124io.openclustermanagement.sdkgo.plugin.proto.v1alpha1\x1a\x19google/protobuf/any.proto\x1a/k8s.io/apimachinery/pkg/runtime/generated.proto\"4\n" + + "\x11InitializeRequest\x12\x1f\n" + "\vocm_version\x18\x01 \x01(\tR\n" + - "ocmVersion\"\xa5\x02\n" + - "\x12InitPluginResponse\x12\x12\n" + + "ocmVersion\"\xb4\x02\n" + + "\x12InitializeResponse\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + - "\aversion\x18\x02 \x01(\tR\aversion\x12j\n" + - "\fcapabilities\x18\x03 \x01(\v2F.io.openclustermanagement.sdkgo.plugin.InitPluginResponse.CapabilitiesR\fcapabilities\x1au\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12y\n" + + "\fcapabilities\x18\x03 \x01(\v2U.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.CapabilitiesR\fcapabilities\x1au\n" + "\fCapabilities\x12\x18\n" + "\arollout\x18\x01 \x01(\bR\arollout\x12\x1a\n" + "\brollback\x18\x02 \x01(\bR\brollback\x12/\n" + "\x13mutate_manifestwork\x18\x03 \x01(\bR\x12mutateManifestwork\"Q\n" + "\x14ClusterRolloutStatus\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12%\n" + - "\x0erollout_status\x18\x02 \x01(\tR\rrolloutStatus\"\xb4\x03\n" + - "\x0eRolloutDetails\x12Y\n" + - "\tcompleted\x18\x01 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\tcompleted\x12\\\n" + - "\vin_progress\x18\x02 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\n" + - "inProgress\x12X\n" + - "\ttimed_out\x18\x03 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\btimedOut\x12U\n" + - "\aremoved\x18\x04 \x03(\v2;.io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatusR\aremoved\x128\n" + + "\x0erollout_status\x18\x02 \x01(\tR\rrolloutStatus\"\xf0\x03\n" + + "\x0eRolloutDetails\x12h\n" + + "\tcompleted\x18\x01 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\tcompleted\x12k\n" + + "\vin_progress\x18\x02 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\n" + + "inProgress\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\"\xa8\x01\n" + "\vRolloutMeta\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\"\xdf\x01\n" + - "\x14RolloutPluginRequest\x12N\n" + - "\bmetadata\x18\x01 \x01(\v22.io.openclustermanagement.sdkgo.plugin.RolloutMetaR\bmetadata\x12c\n" + - "\x0frollout_details\x18\a \x01(\v25.io.openclustermanagement.sdkgo.plugin.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01B\x12\n" + - "\x10_rollout_details\"\x88\x02\n" + - "\x15RolloutPluginResponse\x12[\n" + - "\x06result\x18\x01 \x01(\x0e2C.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.ResultR\x06result\x12\x1d\n" + + "\r_cluster_name\"\xfd\x01\n" + + "\x14RolloutPluginRequest\x12]\n" + + "\bmetadata\x18\x01 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12r\n" + + "\x0frollout_details\x18\a \x01(\v2D.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01B\x12\n" + + "\x10_rollout_details\"\x97\x02\n" + + "\x15RolloutPluginResponse\x12j\n" + + "\x06result\x18\x01 \x01(\x0e2R.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.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\"4\n" + @@ -1099,9 +982,9 @@ const file_rollout_proto_rawDesc = "" + "\x02OK\x10\x01\x12\n" + "\n" + "\x06FAILED\x10\x02B\x06\n" + - "\x04data\"\xa3\x02\n" + - "\x17ValidateRolloutResponse\x12]\n" + - "\x06result\x18\x01 \x01(\x0e2E.io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.ResultR\x06result\x12\x1d\n" + + "\x04data\"\xb2\x02\n" + + "\x17ValidateRolloutResponse\x12l\n" + + "\x06result\x18\x01 \x01(\x0e2T.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.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" + @@ -1112,37 +995,29 @@ const file_rollout_proto_rawDesc = "" + "\x06FAILED\x10\x02\x12\x0e\n" + "\n" + "INPROGRESS\x10\x03B\x06\n" + - "\x04data\"\xd2\x03\n" + - "\x19MutateManifestWorkRequest\x12Y\n" + - "\x04type\x18\x01 \x01(\x0e2E.io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.TypeR\x04type\x12N\n" + - "\bmetadata\x18\x02 \x01(\v22.io.openclustermanagement.sdkgo.plugin.RolloutMetaR\bmetadata\x12c\n" + - "\x0frollout_details\x18\x03 \x01(\v25.io.openclustermanagement.sdkgo.plugin.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01\x12X\n" + - "\fmanifestwork\x18\x04 \x01(\v24.io.openclustermanagement.sdkgo.plugin.RuntimeObjectR\fmanifestwork\"7\n" + - "\x04Type\x12\x14\n" + - "\x10TYPE_UNSPECIFIED\x10\x00\x12\v\n" + + "\x04data\"\x9e\x04\n" + + "\x19MutateManifestWorkRequest\x12\x81\x01\n" + + "\rrollout_state\x18\x01 \x01(\x0e2\\.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutStateR\frolloutState\x12]\n" + + "\bmetadata\x18\x02 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12r\n" + + "\x0frollout_details\x18\x03 \x01(\v2D.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01\x12L\n" + + "\fmanifestwork\x18\x04 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork\"H\n" + + "\fRolloutState\x12\x1d\n" + + "\x19ROLLOUT_STATE_UNSPECIFIED\x10\x00\x12\v\n" + "\aROLLOUT\x10\x01\x12\f\n" + "\bROLLBACK\x10\x02B\x12\n" + - "\x10_rollout_details\"v\n" + - "\x1aMutateManifestWorkResponse\x12X\n" + - "\fmanifestwork\x18\x01 \x01(\v24.io.openclustermanagement.sdkgo.plugin.RuntimeObjectR\fmanifestwork\"?\n" + - "\bTypeMeta\x12\x1f\n" + - "\vapi_version\x18\x01 \x01(\tR\n" + - "apiVersion\x12\x12\n" + - "\x04kind\x18\x02 \x01(\tR\x04kind\"\x91\x01\n" + - "\rRuntimeObject\x12L\n" + - "\ttype_meta\x18\x01 \x01(\v2/.io.openclustermanagement.sdkgo.plugin.TypeMetaR\btypeMeta\x12\x10\n" + - "\x03raw\x18\x02 \x01(\fR\x03raw\x12 \n" + - "\vcontentType\x18\x03 \x01(\tR\vcontentType2\x91\t\n" + - "\x14RolloutPluginService\x12\x81\x01\n" + + "\x10_rollout_details\"j\n" + + "\x1aMutateManifestWorkResponse\x12L\n" + + "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\x81\v\n" + + "\x14RolloutPluginService\x12\x9f\x01\n" + "\n" + - "InitPlugin\x128.io.openclustermanagement.sdkgo.plugin.InitPluginRequest\x1a9.io.openclustermanagement.sdkgo.plugin.InitPluginResponse\x12\x89\x01\n" + - "\fBeginRollout\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8c\x01\n" + - "\x0fProgressRollout\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8e\x01\n" + - "\x0fValidateRollout\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a>.io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse\x12\x8a\x01\n" + - "\rBeginRollback\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8d\x01\n" + - "\x10ProgressRollback\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a<.io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse\x12\x8f\x01\n" + - "\x10ValidateRollback\x12;.io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest\x1a>.io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse\x12\x99\x01\n" + - "\x12MutateManifestWork\x12@.io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest\x1aA.io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponseB1Z/open-cluster-management.io/sdk-go/plugin;pluginb\x06proto3" + "Initialize\x12G.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest\x1aH.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse\x12\xa7\x01\n" + + "\fBeginRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xaa\x01\n" + + "\x0fProgressRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xac\x01\n" + + "\x0fValidateRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aM.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse\x12\xa8\x01\n" + + "\rBeginRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xab\x01\n" + + "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xad\x01\n" + + "\x10ValidateRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aM.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse\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 @@ -1157,65 +1032,63 @@ func file_rollout_proto_rawDescGZIP() []byte { } var file_rollout_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_rollout_proto_goTypes = []any{ - (RolloutPluginResponse_Result)(0), // 0: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.Result - (ValidateRolloutResponse_Result)(0), // 1: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.Result - (MutateManifestWorkRequest_Type)(0), // 2: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.Type - (*InitPluginRequest)(nil), // 3: io.openclustermanagement.sdkgo.plugin.InitPluginRequest - (*InitPluginResponse)(nil), // 4: io.openclustermanagement.sdkgo.plugin.InitPluginResponse - (*ClusterRolloutStatus)(nil), // 5: io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus - (*RolloutDetails)(nil), // 6: io.openclustermanagement.sdkgo.plugin.RolloutDetails - (*RolloutMeta)(nil), // 7: io.openclustermanagement.sdkgo.plugin.RolloutMeta - (*RolloutPluginRequest)(nil), // 8: io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest - (*RolloutPluginResponse)(nil), // 9: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse - (*ValidateRolloutResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse - (*MutateManifestWorkRequest)(nil), // 11: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest - (*MutateManifestWorkResponse)(nil), // 12: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponse - (*TypeMeta)(nil), // 13: io.openclustermanagement.sdkgo.plugin.TypeMeta - (*RuntimeObject)(nil), // 14: io.openclustermanagement.sdkgo.plugin.RuntimeObject - (*InitPluginResponse_Capabilities)(nil), // 15: io.openclustermanagement.sdkgo.plugin.InitPluginResponse.Capabilities - (*anypb.Any)(nil), // 16: google.protobuf.Any + (RolloutPluginResponse_Result)(0), // 0: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.Result + (ValidateRolloutResponse_Result)(0), // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.Result + (MutateManifestWorkRequest_RolloutState)(0), // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState + (*InitializeRequest)(nil), // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest + (*InitializeResponse)(nil), // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse + (*ClusterRolloutStatus)(nil), // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + (*RolloutDetails)(nil), // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails + (*RolloutMeta)(nil), // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta + (*RolloutPluginRequest)(nil), // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + (*RolloutPluginResponse)(nil), // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse + (*ValidateRolloutResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse + (*MutateManifestWorkRequest)(nil), // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest + (*MutateManifestWorkResponse)(nil), // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse + (*InitializeResponse_Capabilities)(nil), // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities + (*anypb.Any)(nil), // 14: google.protobuf.Any + (*runtime.Unknown)(nil), // 15: k8s.io.apimachinery.pkg.runtime.Unknown } var file_rollout_proto_depIdxs = []int32{ - 15, // 0: io.openclustermanagement.sdkgo.plugin.InitPluginResponse.capabilities:type_name -> io.openclustermanagement.sdkgo.plugin.InitPluginResponse.Capabilities - 5, // 1: io.openclustermanagement.sdkgo.plugin.RolloutDetails.completed:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus - 5, // 2: io.openclustermanagement.sdkgo.plugin.RolloutDetails.in_progress:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus - 5, // 3: io.openclustermanagement.sdkgo.plugin.RolloutDetails.timed_out:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus - 5, // 4: io.openclustermanagement.sdkgo.plugin.RolloutDetails.removed:type_name -> io.openclustermanagement.sdkgo.plugin.ClusterRolloutStatus - 7, // 5: io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutMeta - 6, // 6: io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutDetails - 0, // 7: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.Result - 16, // 8: io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse.proto_data:type_name -> google.protobuf.Any - 1, // 9: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.Result - 16, // 10: io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse.proto_data:type_name -> google.protobuf.Any - 2, // 11: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.type:type_name -> io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.Type - 7, // 12: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutMeta - 6, // 13: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.RolloutDetails - 14, // 14: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest.manifestwork:type_name -> io.openclustermanagement.sdkgo.plugin.RuntimeObject - 14, // 15: io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponse.manifestwork:type_name -> io.openclustermanagement.sdkgo.plugin.RuntimeObject - 13, // 16: io.openclustermanagement.sdkgo.plugin.RuntimeObject.type_meta:type_name -> io.openclustermanagement.sdkgo.plugin.TypeMeta - 3, // 17: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.InitPlugin:input_type -> io.openclustermanagement.sdkgo.plugin.InitPluginRequest - 8, // 18: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest - 8, // 19: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest - 8, // 20: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollout:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest - 8, // 21: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest - 8, // 22: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest - 8, // 23: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollback:input_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginRequest - 11, // 24: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.MutateManifestWorkRequest - 4, // 25: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.InitPlugin:output_type -> io.openclustermanagement.sdkgo.plugin.InitPluginResponse - 9, // 26: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollout:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse - 9, // 27: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollout:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse - 10, // 28: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse - 9, // 29: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.BeginRollback:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse - 9, // 30: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ProgressRollback:output_type -> io.openclustermanagement.sdkgo.plugin.RolloutPluginResponse - 10, // 31: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.ValidateRolloutResponse - 12, // 32: io.openclustermanagement.sdkgo.plugin.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.MutateManifestWorkResponse - 25, // [25:33] is the sub-list for method output_type - 17, // [17:25] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 13, // 0: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.capabilities:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities + 5, // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.completed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 5, // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.in_progress:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 5, // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.timed_out:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 5, // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.removed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 7, // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta + 6, // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails + 0, // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.Result + 14, // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.proto_data:type_name -> google.protobuf.Any + 1, // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.Result + 14, // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.proto_data:type_name -> google.protobuf.Any + 2, // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_state:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState + 7, // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta + 6, // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails + 15, // 14: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown + 15, // 15: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown + 3, // 16: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest + 8, // 17: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 18: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 19: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 22: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 11, // 23: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest + 4, // 24: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse + 9, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse + 9, // 26: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse + 10, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse + 9, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse + 9, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse + 10, // 30: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse + 12, // 31: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse + 24, // [24:32] is the sub-list for method output_type + 16, // [16:24] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_rollout_proto_init() } @@ -1240,7 +1113,7 @@ func file_rollout_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_rollout_proto_rawDesc), len(file_rollout_proto_rawDesc)), NumEnums: 3, - NumMessages: 13, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/plugin/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto similarity index 82% rename from pkg/plugin/rollout.proto rename to pkg/plugin/proto/v1alpha1/rollout.proto index 07a0d32b..68bc93b5 100644 --- a/pkg/plugin/rollout.proto +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -4,19 +4,17 @@ syntax = "proto3"; -package io.openclustermanagement.sdkgo.plugin; +package io.openclustermanagement.sdkgo.plugin.proto.v1alpha1; -// import "google/protobuf/struct.proto"; -// import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -// import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; import "google/protobuf/any.proto"; +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -option go_package = "open-cluster-management.io/sdk-go/plugin;plugin"; +option go_package = "open-cluster-management.io/sdk-go/plugin/proto/v1alpha1;v1alpha1"; // RolloutPluginService is the service for the rollout plugin. service RolloutPluginService { - // InitPlugin initializes the plugin - rpc InitPlugin(InitPluginRequest) returns (InitPluginResponse); + // 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. @@ -56,15 +54,15 @@ service RolloutPluginService { rpc MutateManifestWork(MutateManifestWorkRequest) returns (MutateManifestWorkResponse); } -// InitPluginRequest is the request to initialize the plugin. -message InitPluginRequest { +// InitializeRequest is the request to initialize the plugin. +message InitializeRequest { // ocm_version is the version of the OCM API. string ocm_version = 1; } -// InitPluginResponse is the response from the plugin after initialization. +// InitializeResponse is the response from the plugin after initialization. // The plugin returns the name, version, and capabilities of the plugin. -message InitPluginResponse { +message InitializeResponse { // name is the name of the plugin. string name = 1; @@ -112,6 +110,7 @@ message RolloutDetails { int32 placement_total_clusters = 6; } +// RolloutMeta is the metadata of the rollout. message RolloutMeta { // mwrs_name is the name of the manifestwork resource set. string mwrs_name = 1; @@ -194,18 +193,18 @@ message ValidateRolloutResponse { // MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied. message MutateManifestWorkRequest { - enum Type { - TYPE_UNSPECIFIED = 0; + enum RolloutState { + ROLLOUT_STATE_UNSPECIFIED = 0; - // ROLLOUT is the type of the mutation for the rollout. + // ROLLOUT is the rollout state for the rollout. ROLLOUT = 1; - // ROLLBACK is the type of the mutation for the rollback. + // ROLLBACK is the rollout state for the rollback. ROLLBACK = 2; } - // type is the type of the mutation. - Type type = 1; + // rollout_state is the rollout state. + RolloutState rollout_state = 1; // metadata is the metadata of the rollout. RolloutMeta metadata = 2; @@ -214,32 +213,11 @@ message MutateManifestWorkRequest { optional RolloutDetails rollout_details = 3; // manifestwork is the unstructured manifestwork resource. - RuntimeObject manifestwork = 4; + k8s.io.apimachinery.pkg.runtime.Unknown manifestwork = 4; } // MutateManifestWorkResponse is the response to mutate the manifestwork resource before it is applied. message MutateManifestWorkResponse { // manifestwork is the mutated manifestwork resource. - RuntimeObject manifestwork = 1; -} - -// TypeMeta is the type meta of the kubernetes runtime object. -message TypeMeta { - string api_version = 1; - - string kind = 2; -} - -// RuntimeObject is the kubernetes runtime object. -message RuntimeObject { - TypeMeta type_meta = 1; - - // Raw will hold the complete serialized object which couldn't be matched - // with a registered type. Most likely, nothing should be done with this - // except for passing it through the system. - bytes raw = 2; - - // ContentType is serialization method used to serialize 'Raw'. - // Unspecified means ContentTypeJSON. - string contentType = 3; -} + k8s.io.apimachinery.pkg.runtime.Unknown manifestwork = 1; +} \ No newline at end of file diff --git a/pkg/plugin/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go similarity index 90% rename from pkg/plugin/rollout_grpc.pb.go rename to pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go index 79543d45..99897a8d 100644 --- a/pkg/plugin/rollout_grpc.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -8,7 +8,7 @@ // - protoc v6.33.0 // source: rollout.proto -package plugin +package v1alpha1 import ( context "context" @@ -23,14 +23,14 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - RolloutPluginService_InitPlugin_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/InitPlugin" - RolloutPluginService_BeginRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/BeginRollout" - RolloutPluginService_ProgressRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ProgressRollout" - RolloutPluginService_ValidateRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ValidateRollout" - RolloutPluginService_BeginRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/BeginRollback" - RolloutPluginService_ProgressRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ProgressRollback" - RolloutPluginService_ValidateRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/ValidateRollback" - RolloutPluginService_MutateManifestWork_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.RolloutPluginService/MutateManifestWork" + 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_ValidateRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateRollout" + RolloutPluginService_BeginRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/BeginRollback" + RolloutPluginService_ProgressRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ProgressRollback" + RolloutPluginService_ValidateRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateRollback" + RolloutPluginService_MutateManifestWork_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/MutateManifestWork" ) // RolloutPluginServiceClient is the client API for RolloutPluginService service. @@ -39,8 +39,8 @@ const ( // // RolloutPluginService is the service for the rollout plugin. type RolloutPluginServiceClient interface { - // InitPlugin initializes the plugin - InitPlugin(ctx context.Context, in *InitPluginRequest, opts ...grpc.CallOption) (*InitPluginResponse, error) + // 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) (*RolloutPluginResponse, error) @@ -81,10 +81,10 @@ func NewRolloutPluginServiceClient(cc grpc.ClientConnInterface) RolloutPluginSer return &rolloutPluginServiceClient{cc} } -func (c *rolloutPluginServiceClient) InitPlugin(ctx context.Context, in *InitPluginRequest, opts ...grpc.CallOption) (*InitPluginResponse, error) { +func (c *rolloutPluginServiceClient) Initialize(ctx context.Context, in *InitializeRequest, opts ...grpc.CallOption) (*InitializeResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(InitPluginResponse) - err := c.cc.Invoke(ctx, RolloutPluginService_InitPlugin_FullMethodName, in, out, cOpts...) + out := new(InitializeResponse) + err := c.cc.Invoke(ctx, RolloutPluginService_Initialize_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -167,8 +167,8 @@ func (c *rolloutPluginServiceClient) MutateManifestWork(ctx context.Context, in // // RolloutPluginService is the service for the rollout plugin. type RolloutPluginServiceServer interface { - // InitPlugin initializes the plugin - InitPlugin(context.Context, *InitPluginRequest) (*InitPluginResponse, error) + // 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) (*RolloutPluginResponse, error) @@ -209,8 +209,8 @@ type RolloutPluginServiceServer interface { // pointer dereference when methods are called. type UnimplementedRolloutPluginServiceServer struct{} -func (UnimplementedRolloutPluginServiceServer) InitPlugin(context.Context, *InitPluginRequest) (*InitPluginResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitPlugin not implemented") +func (UnimplementedRolloutPluginServiceServer) Initialize(context.Context, *InitializeRequest) (*InitializeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented") } func (UnimplementedRolloutPluginServiceServer) BeginRollout(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BeginRollout not implemented") @@ -254,20 +254,20 @@ func RegisterRolloutPluginServiceServer(s grpc.ServiceRegistrar, srv RolloutPlug s.RegisterService(&RolloutPluginService_ServiceDesc, srv) } -func _RolloutPluginService_InitPlugin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InitPluginRequest) +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).InitPlugin(ctx, in) + return srv.(RolloutPluginServiceServer).Initialize(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: RolloutPluginService_InitPlugin_FullMethodName, + FullMethod: RolloutPluginService_Initialize_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).InitPlugin(ctx, req.(*InitPluginRequest)) + return srv.(RolloutPluginServiceServer).Initialize(ctx, req.(*InitializeRequest)) } return interceptor(ctx, in, info, handler) } @@ -402,12 +402,12 @@ func _RolloutPluginService_MutateManifestWork_Handler(srv interface{}, ctx conte // 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.RolloutPluginService", + ServiceName: "io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService", HandlerType: (*RolloutPluginServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "InitPlugin", - Handler: _RolloutPluginService_InitPlugin_Handler, + MethodName: "Initialize", + Handler: _RolloutPluginService_Initialize_Handler, }, { MethodName: "BeginRollout", From 109242f257707f5f250e178bea05f12137bbce8b Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Sat, 25 Oct 2025 06:41:55 -0700 Subject: [PATCH 4/9] rename --- pkg/plugin/proto/v1alpha1/rollout.pb.go | 117 ++++++++++--------- pkg/plugin/proto/v1alpha1/rollout.proto | 8 +- pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go | 20 ++-- 3 files changed, 73 insertions(+), 72 deletions(-) diff --git a/pkg/plugin/proto/v1alpha1/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go index 2e7498dd..6ce02a33 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -80,31 +80,31 @@ func (RolloutPluginResponse_Result) EnumDescriptor() ([]byte, []int) { } // Result is the result of the validation response. -type ValidateRolloutResponse_Result int32 +type ValidateResponse_Result int32 const ( // RESULT_UNSPECIFIED is the unspecified result. - ValidateRolloutResponse_RESULT_UNSPECIFIED ValidateRolloutResponse_Result = 0 + 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. - ValidateRolloutResponse_SUCCEEDED ValidateRolloutResponse_Result = 1 + ValidateResponse_SUCCEEDED ValidateResponse_Result = 1 // FAILED represents the failed result of the validation. // MWRS Controller stops the current rollout and rollback is triggered if the rollback is required. - ValidateRolloutResponse_FAILED ValidateRolloutResponse_Result = 2 + 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. - ValidateRolloutResponse_INPROGRESS ValidateRolloutResponse_Result = 3 + ValidateResponse_INPROGRESS ValidateResponse_Result = 3 ) -// Enum value maps for ValidateRolloutResponse_Result. +// Enum value maps for ValidateResponse_Result. var ( - ValidateRolloutResponse_Result_name = map[int32]string{ + ValidateResponse_Result_name = map[int32]string{ 0: "RESULT_UNSPECIFIED", 1: "SUCCEEDED", 2: "FAILED", 3: "INPROGRESS", } - ValidateRolloutResponse_Result_value = map[string]int32{ + ValidateResponse_Result_value = map[string]int32{ "RESULT_UNSPECIFIED": 0, "SUCCEEDED": 1, "FAILED": 2, @@ -112,30 +112,30 @@ var ( } ) -func (x ValidateRolloutResponse_Result) Enum() *ValidateRolloutResponse_Result { - p := new(ValidateRolloutResponse_Result) +func (x ValidateResponse_Result) Enum() *ValidateResponse_Result { + p := new(ValidateResponse_Result) *p = x return p } -func (x ValidateRolloutResponse_Result) String() string { +func (x ValidateResponse_Result) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (ValidateRolloutResponse_Result) Descriptor() protoreflect.EnumDescriptor { +func (ValidateResponse_Result) Descriptor() protoreflect.EnumDescriptor { return file_rollout_proto_enumTypes[1].Descriptor() } -func (ValidateRolloutResponse_Result) Type() protoreflect.EnumType { +func (ValidateResponse_Result) Type() protoreflect.EnumType { return &file_rollout_proto_enumTypes[1] } -func (x ValidateRolloutResponse_Result) Number() protoreflect.EnumNumber { +func (x ValidateResponse_Result) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use ValidateRolloutResponse_Result.Descriptor instead. -func (ValidateRolloutResponse_Result) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use ValidateResponse_Result.Descriptor instead. +func (ValidateResponse_Result) EnumDescriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{7, 0} } @@ -660,34 +660,34 @@ func (*RolloutPluginResponse_TextData) isRolloutPluginResponse_Data() {} func (*RolloutPluginResponse_ProtoData) isRolloutPluginResponse_Data() {} -// ValidateRolloutResponse is the response from the plugin for the validation of the rollout. -type ValidateRolloutResponse struct { +// ValidateResponse is the response from the plugin for the validation of the rollout. +type ValidateResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // result is the result of the response. - Result ValidateRolloutResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse_Result" json:"result,omitempty"` + 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: // - // *ValidateRolloutResponse_TextData - // *ValidateRolloutResponse_ProtoData - Data isValidateRolloutResponse_Data `protobuf_oneof:"data"` + // *ValidateResponse_TextData + // *ValidateResponse_ProtoData + Data isValidateResponse_Data `protobuf_oneof:"data"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *ValidateRolloutResponse) Reset() { - *x = ValidateRolloutResponse{} +func (x *ValidateResponse) Reset() { + *x = ValidateResponse{} mi := &file_rollout_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *ValidateRolloutResponse) String() string { +func (x *ValidateResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ValidateRolloutResponse) ProtoMessage() {} +func (*ValidateResponse) ProtoMessage() {} -func (x *ValidateRolloutResponse) ProtoReflect() protoreflect.Message { +func (x *ValidateResponse) ProtoReflect() protoreflect.Message { mi := &file_rollout_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -699,60 +699,60 @@ func (x *ValidateRolloutResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ValidateRolloutResponse.ProtoReflect.Descriptor instead. -func (*ValidateRolloutResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ValidateResponse.ProtoReflect.Descriptor instead. +func (*ValidateResponse) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{7} } -func (x *ValidateRolloutResponse) GetResult() ValidateRolloutResponse_Result { +func (x *ValidateResponse) GetResult() ValidateResponse_Result { if x != nil { return x.Result } - return ValidateRolloutResponse_RESULT_UNSPECIFIED + return ValidateResponse_RESULT_UNSPECIFIED } -func (x *ValidateRolloutResponse) GetData() isValidateRolloutResponse_Data { +func (x *ValidateResponse) GetData() isValidateResponse_Data { if x != nil { return x.Data } return nil } -func (x *ValidateRolloutResponse) GetTextData() string { +func (x *ValidateResponse) GetTextData() string { if x != nil { - if x, ok := x.Data.(*ValidateRolloutResponse_TextData); ok { + if x, ok := x.Data.(*ValidateResponse_TextData); ok { return x.TextData } } return "" } -func (x *ValidateRolloutResponse) GetProtoData() *anypb.Any { +func (x *ValidateResponse) GetProtoData() *anypb.Any { if x != nil { - if x, ok := x.Data.(*ValidateRolloutResponse_ProtoData); ok { + if x, ok := x.Data.(*ValidateResponse_ProtoData); ok { return x.ProtoData } } return nil } -type isValidateRolloutResponse_Data interface { - isValidateRolloutResponse_Data() +type isValidateResponse_Data interface { + isValidateResponse_Data() } -type ValidateRolloutResponse_TextData struct { +type ValidateResponse_TextData struct { // text_data is the text data of the response. TextData string `protobuf:"bytes,2,opt,name=text_data,json=textData,proto3,oneof"` } -type ValidateRolloutResponse_ProtoData struct { +type ValidateResponse_ProtoData struct { // proto_data is the protobuf data of the response. ProtoData *anypb.Any `protobuf:"bytes,3,opt,name=proto_data,json=protoData,proto3,oneof"` } -func (*ValidateRolloutResponse_TextData) isValidateRolloutResponse_Data() {} +func (*ValidateResponse_TextData) isValidateResponse_Data() {} -func (*ValidateRolloutResponse_ProtoData) isValidateRolloutResponse_Data() {} +func (*ValidateResponse_ProtoData) isValidateResponse_Data() {} // MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied. type MutateManifestWorkRequest struct { @@ -982,9 +982,9 @@ const file_rollout_proto_rawDesc = "" + "\x02OK\x10\x01\x12\n" + "\n" + "\x06FAILED\x10\x02B\x06\n" + - "\x04data\"\xb2\x02\n" + - "\x17ValidateRolloutResponse\x12l\n" + - "\x06result\x18\x01 \x01(\x0e2T.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.ResultR\x06result\x12\x1d\n" + + "\x04data\"\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" + @@ -1007,16 +1007,17 @@ const file_rollout_proto_rawDesc = "" + "\bROLLBACK\x10\x02B\x12\n" + "\x10_rollout_details\"j\n" + "\x1aMutateManifestWorkResponse\x12L\n" + - "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\x81\v\n" + + "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\xf3\n" + + "\n" + "\x14RolloutPluginService\x12\x9f\x01\n" + "\n" + "Initialize\x12G.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest\x1aH.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse\x12\xa7\x01\n" + "\fBeginRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xaa\x01\n" + - "\x0fProgressRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xac\x01\n" + - "\x0fValidateRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aM.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse\x12\xa8\x01\n" + + "\x0fProgressRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xa5\x01\n" + + "\x0fValidateRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12\xa8\x01\n" + "\rBeginRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xab\x01\n" + - "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xad\x01\n" + - "\x10ValidateRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aM.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse\x12\xb7\x01\n" + + "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xa6\x01\n" + + "\x10ValidateRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\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 ( @@ -1035,7 +1036,7 @@ var file_rollout_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_rollout_proto_goTypes = []any{ (RolloutPluginResponse_Result)(0), // 0: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.Result - (ValidateRolloutResponse_Result)(0), // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.Result + (ValidateResponse_Result)(0), // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result (MutateManifestWorkRequest_RolloutState)(0), // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState (*InitializeRequest)(nil), // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest (*InitializeResponse)(nil), // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse @@ -1044,7 +1045,7 @@ var file_rollout_proto_goTypes = []any{ (*RolloutMeta)(nil), // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta (*RolloutPluginRequest)(nil), // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest (*RolloutPluginResponse)(nil), // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - (*ValidateRolloutResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse + (*ValidateResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse (*MutateManifestWorkRequest)(nil), // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest (*MutateManifestWorkResponse)(nil), // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse (*InitializeResponse_Capabilities)(nil), // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities @@ -1061,8 +1062,8 @@ var file_rollout_proto_depIdxs = []int32{ 6, // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails 0, // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.Result 14, // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.proto_data:type_name -> google.protobuf.Any - 1, // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.Result - 14, // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse.proto_data:type_name -> google.protobuf.Any + 1, // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result + 14, // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.proto_data:type_name -> google.protobuf.Any 2, // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_state:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState 7, // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta 6, // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails @@ -1079,10 +1080,10 @@ var file_rollout_proto_depIdxs = []int32{ 4, // 24: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse 9, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse 9, // 26: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - 10, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse + 10, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse 9, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse 9, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - 10, // 30: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateRolloutResponse + 10, // 30: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse 12, // 31: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse 24, // [24:32] is the sub-list for method output_type 16, // [16:24] is the sub-list for method input_type @@ -1103,8 +1104,8 @@ func file_rollout_proto_init() { (*RolloutPluginResponse_ProtoData)(nil), } file_rollout_proto_msgTypes[7].OneofWrappers = []any{ - (*ValidateRolloutResponse_TextData)(nil), - (*ValidateRolloutResponse_ProtoData)(nil), + (*ValidateResponse_TextData)(nil), + (*ValidateResponse_ProtoData)(nil), } file_rollout_proto_msgTypes[8].OneofWrappers = []any{} type x struct{} diff --git a/pkg/plugin/proto/v1alpha1/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto index 68bc93b5..f10e748b 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.proto +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -30,7 +30,7 @@ service RolloutPluginService { // If the validation is completed successfully, the plugin should return a OK result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - rpc ValidateRollout(RolloutPluginRequest) returns (ValidateRolloutResponse); + rpc ValidateRollout(RolloutPluginRequest) returns (ValidateResponse); // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. @@ -46,7 +46,7 @@ service RolloutPluginService { // If the validation is completed successfully, the plugin should return a OK result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - rpc ValidateRollback(RolloutPluginRequest) returns (ValidateRolloutResponse); + rpc ValidateRollback(RolloutPluginRequest) returns (ValidateResponse); // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. @@ -159,8 +159,8 @@ message RolloutPluginResponse { } } -// ValidateRolloutResponse is the response from the plugin for the validation of the rollout. -message ValidateRolloutResponse { +// ValidateResponse is the response from the plugin for the validation of the rollout. +message ValidateResponse { // Result is the result of the validation response. enum Result { // RESULT_UNSPECIFIED is the unspecified result. diff --git a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go index 99897a8d..a3ece409 100644 --- a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -53,7 +53,7 @@ type RolloutPluginServiceClient interface { // If the validation is completed successfully, the plugin should return a OK result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) + ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) @@ -66,7 +66,7 @@ type RolloutPluginServiceClient interface { // If the validation is completed successfully, the plugin should return a OK result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) + ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. // The plugin can use this information to mutate the manifestwork resource. @@ -111,9 +111,9 @@ func (c *rolloutPluginServiceClient) ProgressRollout(ctx context.Context, in *Ro return out, nil } -func (c *rolloutPluginServiceClient) ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) { +func (c *rolloutPluginServiceClient) ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ValidateRolloutResponse) + out := new(ValidateResponse) err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRollout_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -141,9 +141,9 @@ func (c *rolloutPluginServiceClient) ProgressRollback(ctx context.Context, in *R return out, nil } -func (c *rolloutPluginServiceClient) ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateRolloutResponse, error) { +func (c *rolloutPluginServiceClient) ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ValidateRolloutResponse) + out := new(ValidateResponse) err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRollback_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -181,7 +181,7 @@ type RolloutPluginServiceServer interface { // If the validation is completed successfully, the plugin should return a OK result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) + ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. BeginRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) @@ -194,7 +194,7 @@ type RolloutPluginServiceServer interface { // If the validation is completed successfully, the plugin should return a OK result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) + ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. // The plugin can use this information to mutate the manifestwork resource. @@ -218,7 +218,7 @@ func (UnimplementedRolloutPluginServiceServer) BeginRollout(context.Context, *Ro func (UnimplementedRolloutPluginServiceServer) ProgressRollout(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollout not implemented") } -func (UnimplementedRolloutPluginServiceServer) ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) { +func (UnimplementedRolloutPluginServiceServer) ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateRollout not implemented") } func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { @@ -227,7 +227,7 @@ func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *R func (UnimplementedRolloutPluginServiceServer) ProgressRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollback not implemented") } -func (UnimplementedRolloutPluginServiceServer) ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateRolloutResponse, error) { +func (UnimplementedRolloutPluginServiceServer) ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateRollback not implemented") } func (UnimplementedRolloutPluginServiceServer) MutateManifestWork(context.Context, *MutateManifestWorkRequest) (*MutateManifestWorkResponse, error) { From e538d72855e785889da24eb2b454bb58535b43a9 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Tue, 28 Oct 2025 01:59:13 -0700 Subject: [PATCH 5/9] regen --- pkg/plugin/proto/v1alpha1/rollout.pb.go | 328 +++++-------------- pkg/plugin/proto/v1alpha1/rollout.proto | 35 +- pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go | 41 +-- 3 files changed, 109 insertions(+), 295 deletions(-) diff --git a/pkg/plugin/proto/v1alpha1/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go index 6ce02a33..4785930c 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -14,6 +14,7 @@ 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" @@ -27,58 +28,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Result is the result of the plugin response. -type RolloutPluginResponse_Result int32 - -const ( - RolloutPluginResponse_RESULT_UNSPECIFIED RolloutPluginResponse_Result = 0 - // OK is the ok response. - RolloutPluginResponse_OK RolloutPluginResponse_Result = 1 - // FAILED is the failed response. - RolloutPluginResponse_FAILED RolloutPluginResponse_Result = 2 -) - -// Enum value maps for RolloutPluginResponse_Result. -var ( - RolloutPluginResponse_Result_name = map[int32]string{ - 0: "RESULT_UNSPECIFIED", - 1: "OK", - 2: "FAILED", - } - RolloutPluginResponse_Result_value = map[string]int32{ - "RESULT_UNSPECIFIED": 0, - "OK": 1, - "FAILED": 2, - } -) - -func (x RolloutPluginResponse_Result) Enum() *RolloutPluginResponse_Result { - p := new(RolloutPluginResponse_Result) - *p = x - return p -} - -func (x RolloutPluginResponse_Result) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RolloutPluginResponse_Result) Descriptor() protoreflect.EnumDescriptor { - return file_rollout_proto_enumTypes[0].Descriptor() -} - -func (RolloutPluginResponse_Result) Type() protoreflect.EnumType { - return &file_rollout_proto_enumTypes[0] -} - -func (x RolloutPluginResponse_Result) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RolloutPluginResponse_Result.Descriptor instead. -func (RolloutPluginResponse_Result) EnumDescriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{6, 0} -} - // Result is the result of the validation response. type ValidateResponse_Result int32 @@ -123,11 +72,11 @@ func (x ValidateResponse_Result) String() string { } func (ValidateResponse_Result) Descriptor() protoreflect.EnumDescriptor { - return file_rollout_proto_enumTypes[1].Descriptor() + return file_rollout_proto_enumTypes[0].Descriptor() } func (ValidateResponse_Result) Type() protoreflect.EnumType { - return &file_rollout_proto_enumTypes[1] + return &file_rollout_proto_enumTypes[0] } func (x ValidateResponse_Result) Number() protoreflect.EnumNumber { @@ -136,7 +85,7 @@ func (x ValidateResponse_Result) Number() protoreflect.EnumNumber { // Deprecated: Use ValidateResponse_Result.Descriptor instead. func (ValidateResponse_Result) EnumDescriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{7, 0} + return file_rollout_proto_rawDescGZIP(), []int{6, 0} } type MutateManifestWorkRequest_RolloutState int32 @@ -174,11 +123,11 @@ func (x MutateManifestWorkRequest_RolloutState) String() string { } func (MutateManifestWorkRequest_RolloutState) Descriptor() protoreflect.EnumDescriptor { - return file_rollout_proto_enumTypes[2].Descriptor() + return file_rollout_proto_enumTypes[1].Descriptor() } func (MutateManifestWorkRequest_RolloutState) Type() protoreflect.EnumType { - return &file_rollout_proto_enumTypes[2] + return &file_rollout_proto_enumTypes[1] } func (x MutateManifestWorkRequest_RolloutState) Number() protoreflect.EnumNumber { @@ -187,7 +136,7 @@ func (x MutateManifestWorkRequest_RolloutState) Number() protoreflect.EnumNumber // Deprecated: Use MutateManifestWorkRequest_RolloutState.Descriptor instead. func (MutateManifestWorkRequest_RolloutState) EnumDescriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{8, 0} + return file_rollout_proto_rawDescGZIP(), []int{7, 0} } // InitializeRequest is the request to initialize the plugin. @@ -566,100 +515,6 @@ func (x *RolloutPluginRequest) GetRolloutDetails() *RolloutDetails { return nil } -// RolloutPluginResponse is the response from the plugin. -type RolloutPluginResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // result is the result of the response. - Result RolloutPluginResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse_Result" json:"result,omitempty"` - // Types that are valid to be assigned to Data: - // - // *RolloutPluginResponse_TextData - // *RolloutPluginResponse_ProtoData - Data isRolloutPluginResponse_Data `protobuf_oneof:"data"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RolloutPluginResponse) Reset() { - *x = RolloutPluginResponse{} - mi := &file_rollout_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RolloutPluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RolloutPluginResponse) ProtoMessage() {} - -func (x *RolloutPluginResponse) 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 RolloutPluginResponse.ProtoReflect.Descriptor instead. -func (*RolloutPluginResponse) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{6} -} - -func (x *RolloutPluginResponse) GetResult() RolloutPluginResponse_Result { - if x != nil { - return x.Result - } - return RolloutPluginResponse_RESULT_UNSPECIFIED -} - -func (x *RolloutPluginResponse) GetData() isRolloutPluginResponse_Data { - if x != nil { - return x.Data - } - return nil -} - -func (x *RolloutPluginResponse) GetTextData() string { - if x != nil { - if x, ok := x.Data.(*RolloutPluginResponse_TextData); ok { - return x.TextData - } - } - return "" -} - -func (x *RolloutPluginResponse) GetProtoData() *anypb.Any { - if x != nil { - if x, ok := x.Data.(*RolloutPluginResponse_ProtoData); ok { - return x.ProtoData - } - } - return nil -} - -type isRolloutPluginResponse_Data interface { - isRolloutPluginResponse_Data() -} - -type RolloutPluginResponse_TextData struct { - // text_data is the text data of the response. - TextData string `protobuf:"bytes,2,opt,name=text_data,json=textData,proto3,oneof"` -} - -type RolloutPluginResponse_ProtoData struct { - // proto_data is the protobuf data of the response. - ProtoData *anypb.Any `protobuf:"bytes,3,opt,name=proto_data,json=protoData,proto3,oneof"` -} - -func (*RolloutPluginResponse_TextData) isRolloutPluginResponse_Data() {} - -func (*RolloutPluginResponse_ProtoData) isRolloutPluginResponse_Data() {} - // ValidateResponse is the response from the plugin for the validation of the rollout. type ValidateResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -676,7 +531,7 @@ type ValidateResponse struct { func (x *ValidateResponse) Reset() { *x = ValidateResponse{} - mi := &file_rollout_proto_msgTypes[7] + mi := &file_rollout_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -688,7 +543,7 @@ func (x *ValidateResponse) String() string { func (*ValidateResponse) ProtoMessage() {} func (x *ValidateResponse) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[7] + mi := &file_rollout_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -701,7 +556,7 @@ func (x *ValidateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidateResponse.ProtoReflect.Descriptor instead. func (*ValidateResponse) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{7} + return file_rollout_proto_rawDescGZIP(), []int{6} } func (x *ValidateResponse) GetResult() ValidateResponse_Result { @@ -771,7 +626,7 @@ type MutateManifestWorkRequest struct { func (x *MutateManifestWorkRequest) Reset() { *x = MutateManifestWorkRequest{} - mi := &file_rollout_proto_msgTypes[8] + mi := &file_rollout_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -783,7 +638,7 @@ func (x *MutateManifestWorkRequest) String() string { func (*MutateManifestWorkRequest) ProtoMessage() {} func (x *MutateManifestWorkRequest) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[8] + mi := &file_rollout_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -796,7 +651,7 @@ func (x *MutateManifestWorkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MutateManifestWorkRequest.ProtoReflect.Descriptor instead. func (*MutateManifestWorkRequest) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{8} + return file_rollout_proto_rawDescGZIP(), []int{7} } func (x *MutateManifestWorkRequest) GetRolloutState() MutateManifestWorkRequest_RolloutState { @@ -838,7 +693,7 @@ type MutateManifestWorkResponse struct { func (x *MutateManifestWorkResponse) Reset() { *x = MutateManifestWorkResponse{} - mi := &file_rollout_proto_msgTypes[9] + mi := &file_rollout_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -850,7 +705,7 @@ func (x *MutateManifestWorkResponse) String() string { func (*MutateManifestWorkResponse) ProtoMessage() {} func (x *MutateManifestWorkResponse) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[9] + mi := &file_rollout_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -863,7 +718,7 @@ func (x *MutateManifestWorkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MutateManifestWorkResponse.ProtoReflect.Descriptor instead. func (*MutateManifestWorkResponse) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{9} + return file_rollout_proto_rawDescGZIP(), []int{8} } func (x *MutateManifestWorkResponse) GetManifestwork() *runtime.Unknown { @@ -887,7 +742,7 @@ type InitializeResponse_Capabilities struct { func (x *InitializeResponse_Capabilities) Reset() { *x = InitializeResponse_Capabilities{} - mi := &file_rollout_proto_msgTypes[10] + mi := &file_rollout_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -899,7 +754,7 @@ func (x *InitializeResponse_Capabilities) String() string { func (*InitializeResponse_Capabilities) ProtoMessage() {} func (x *InitializeResponse_Capabilities) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[10] + mi := &file_rollout_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -940,7 +795,7 @@ 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/k8s.io/apimachinery/pkg/runtime/generated.proto\"4\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\"\xb4\x02\n" + @@ -971,18 +826,7 @@ const file_rollout_proto_rawDesc = "" + "\x14RolloutPluginRequest\x12]\n" + "\bmetadata\x18\x01 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12r\n" + "\x0frollout_details\x18\a \x01(\v2D.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01B\x12\n" + - "\x10_rollout_details\"\x97\x02\n" + - "\x15RolloutPluginResponse\x12j\n" + - "\x06result\x18\x01 \x01(\x0e2R.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.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\"4\n" + - "\x06Result\x12\x16\n" + - "\x12RESULT_UNSPECIFIED\x10\x00\x12\x06\n" + - "\x02OK\x10\x01\x12\n" + - "\n" + - "\x06FAILED\x10\x02B\x06\n" + - "\x04data\"\xa4\x02\n" + + "\x10_rollout_details\"\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" + @@ -1007,16 +851,15 @@ const file_rollout_proto_rawDesc = "" + "\bROLLBACK\x10\x02B\x12\n" + "\x10_rollout_details\"j\n" + "\x1aMutateManifestWorkResponse\x12L\n" + - "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\xf3\n" + - "\n" + + "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\x9b\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\x12\xa7\x01\n" + - "\fBeginRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xaa\x01\n" + - "\x0fProgressRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xa5\x01\n" + - "\x0fValidateRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12\xa8\x01\n" + - "\rBeginRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xab\x01\n" + - "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aK.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse\x12\xa6\x01\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\xa5\x01\n" + + "\x0fValidateRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12s\n" + + "\rBeginRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12v\n" + + "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xa6\x01\n" + "\x10ValidateRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\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" @@ -1032,64 +875,61 @@ func file_rollout_proto_rawDescGZIP() []byte { return file_rollout_proto_rawDescData } -var file_rollout_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_rollout_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_rollout_proto_goTypes = []any{ - (RolloutPluginResponse_Result)(0), // 0: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.Result - (ValidateResponse_Result)(0), // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result - (MutateManifestWorkRequest_RolloutState)(0), // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState - (*InitializeRequest)(nil), // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest - (*InitializeResponse)(nil), // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse - (*ClusterRolloutStatus)(nil), // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - (*RolloutDetails)(nil), // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails - (*RolloutMeta)(nil), // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta - (*RolloutPluginRequest)(nil), // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - (*RolloutPluginResponse)(nil), // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - (*ValidateResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse - (*MutateManifestWorkRequest)(nil), // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest - (*MutateManifestWorkResponse)(nil), // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse - (*InitializeResponse_Capabilities)(nil), // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities - (*anypb.Any)(nil), // 14: google.protobuf.Any - (*runtime.Unknown)(nil), // 15: k8s.io.apimachinery.pkg.runtime.Unknown + (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 + (*RolloutDetails)(nil), // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails + (*RolloutMeta)(nil), // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta + (*RolloutPluginRequest)(nil), // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + (*ValidateResponse)(nil), // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + (*MutateManifestWorkRequest)(nil), // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest + (*MutateManifestWorkResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse + (*InitializeResponse_Capabilities)(nil), // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities + (*anypb.Any)(nil), // 12: google.protobuf.Any + (*runtime.Unknown)(nil), // 13: k8s.io.apimachinery.pkg.runtime.Unknown + (*emptypb.Empty)(nil), // 14: google.protobuf.Empty } var file_rollout_proto_depIdxs = []int32{ - 13, // 0: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.capabilities:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities - 5, // 1: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.completed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - 5, // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.in_progress:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - 5, // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.timed_out:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - 5, // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.removed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - 7, // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta - 6, // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails - 0, // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.Result - 14, // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse.proto_data:type_name -> google.protobuf.Any - 1, // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result - 14, // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.proto_data:type_name -> google.protobuf.Any - 2, // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_state:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState - 7, // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta - 6, // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails - 15, // 14: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown - 15, // 15: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown - 3, // 16: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest - 8, // 17: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 8, // 18: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 8, // 19: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 8, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 8, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 8, // 22: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 11, // 23: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest - 4, // 24: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse - 9, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - 9, // 26: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - 10, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse - 9, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - 9, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginResponse - 10, // 30: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse - 12, // 31: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse - 24, // [24:32] is the sub-list for method output_type - 16, // [16:24] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 11, // 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.RolloutDetails.completed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 4, // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.in_progress:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 4, // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.timed_out:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 4, // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.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.RolloutMeta + 5, // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails + 0, // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result + 12, // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.proto_data:type_name -> google.protobuf.Any + 1, // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_state:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState + 6, // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta + 5, // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails + 13, // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown + 13, // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown + 2, // 14: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest + 7, // 15: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 16: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 17: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 18: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 19: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 9, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest + 3, // 22: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse + 14, // 23: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:output_type -> google.protobuf.Empty + 14, // 24: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:output_type -> google.protobuf.Empty + 8, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + 14, // 26: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:output_type -> google.protobuf.Empty + 14, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> google.protobuf.Empty + 8, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + 10, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse + 22, // [22:30] is the sub-list for method output_type + 14, // [14:22] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_rollout_proto_init() } @@ -1100,21 +940,17 @@ func file_rollout_proto_init() { file_rollout_proto_msgTypes[4].OneofWrappers = []any{} file_rollout_proto_msgTypes[5].OneofWrappers = []any{} file_rollout_proto_msgTypes[6].OneofWrappers = []any{ - (*RolloutPluginResponse_TextData)(nil), - (*RolloutPluginResponse_ProtoData)(nil), - } - file_rollout_proto_msgTypes[7].OneofWrappers = []any{ (*ValidateResponse_TextData)(nil), (*ValidateResponse_ProtoData)(nil), } - file_rollout_proto_msgTypes[8].OneofWrappers = []any{} + file_rollout_proto_msgTypes[7].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: 3, - NumMessages: 11, + NumEnums: 2, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/plugin/proto/v1alpha1/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto index f10e748b..5204f0c6 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.proto +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -7,6 +7,8 @@ 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"; @@ -18,12 +20,12 @@ service RolloutPluginService { // BeginRollout is called before the manifestwork resource is applied. // It is used to prepare the rollout. - rpc BeginRollout(RolloutPluginRequest) returns (RolloutPluginResponse); + 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 (RolloutPluginResponse); + rpc ProgressRollout(RolloutPluginRequest) returns (google.protobuf.Empty); // ValidateRollout is called to validate the completion of the rollout. // It is used to check if the rollout is completed successfully. @@ -34,12 +36,12 @@ service RolloutPluginService { // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. - rpc BeginRollback(RolloutPluginRequest) returns (RolloutPluginResponse); + rpc BeginRollback(RolloutPluginRequest) returns (google.protobuf.Empty); // ProgressRollback is called after the manifestwork is rolled back. // Whenever the feedbacks are updated, this method will be called. // The plugin can execute the rollback logic based on the feedback status changes. - rpc ProgressRollback(RolloutPluginRequest) returns (RolloutPluginResponse); + rpc ProgressRollback(RolloutPluginRequest) returns (google.protobuf.Empty); // ValidateRollback is called to validate the completion of the rollback. // It is used to check if the rollback is completed successfully. @@ -134,31 +136,6 @@ message RolloutPluginRequest { optional RolloutDetails rollout_details = 7; } -// RolloutPluginResponse is the response from the plugin. -message RolloutPluginResponse { - // Result is the result of the plugin response. - enum Result { - RESULT_UNSPECIFIED = 0; - - // OK is the ok response. - OK = 1; - - // FAILED is the failed response. - FAILED = 2; - } - - // result is the result of the response. - Result result = 1; - - oneof data { - // text_data is the text data of the response. - string text_data = 2; - - // proto_data is the protobuf data of the response. - google.protobuf.Any proto_data = 3; - } -} - // ValidateResponse is the response from the plugin for the validation of the rollout. message ValidateResponse { // Result is the result of the validation response. diff --git a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go index a3ece409..915626fb 100644 --- a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -15,6 +15,7 @@ import ( 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 @@ -43,11 +44,11 @@ type RolloutPluginServiceClient interface { 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) (*RolloutPluginResponse, error) + 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) (*RolloutPluginResponse, error) + ProgressRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // ValidateRollout 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 OK result. @@ -56,11 +57,11 @@ type RolloutPluginServiceClient interface { ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. - BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) + BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // ProgressRollback is called after the manifestwork is rolled back. // Whenever the feedbacks are updated, this method will be called. // The plugin can execute the rollback logic based on the feedback status changes. - ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) + ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // ValidateRollback is called to validate the completion of the rollback. // It is used to check if the rollback is completed successfully. // If the validation is completed successfully, the plugin should return a OK result. @@ -91,9 +92,9 @@ func (c *rolloutPluginServiceClient) Initialize(ctx context.Context, in *Initial return out, nil } -func (c *rolloutPluginServiceClient) BeginRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) { +func (c *rolloutPluginServiceClient) BeginRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RolloutPluginResponse) + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, RolloutPluginService_BeginRollout_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -101,9 +102,9 @@ func (c *rolloutPluginServiceClient) BeginRollout(ctx context.Context, in *Rollo return out, nil } -func (c *rolloutPluginServiceClient) ProgressRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) { +func (c *rolloutPluginServiceClient) ProgressRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RolloutPluginResponse) + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, RolloutPluginService_ProgressRollout_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -121,9 +122,9 @@ func (c *rolloutPluginServiceClient) ValidateRollout(ctx context.Context, in *Ro return out, nil } -func (c *rolloutPluginServiceClient) BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) { +func (c *rolloutPluginServiceClient) BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RolloutPluginResponse) + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, RolloutPluginService_BeginRollback_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -131,9 +132,9 @@ func (c *rolloutPluginServiceClient) BeginRollback(ctx context.Context, in *Roll return out, nil } -func (c *rolloutPluginServiceClient) ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*RolloutPluginResponse, error) { +func (c *rolloutPluginServiceClient) ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RolloutPluginResponse) + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, RolloutPluginService_ProgressRollback_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -171,11 +172,11 @@ type RolloutPluginServiceServer interface { 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) (*RolloutPluginResponse, error) + 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) (*RolloutPluginResponse, error) + ProgressRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) // ValidateRollout 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 OK result. @@ -184,11 +185,11 @@ type RolloutPluginServiceServer interface { ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. - BeginRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) + BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) // ProgressRollback is called after the manifestwork is rolled back. // Whenever the feedbacks are updated, this method will be called. // The plugin can execute the rollback logic based on the feedback status changes. - ProgressRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) + ProgressRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) // ValidateRollback is called to validate the completion of the rollback. // It is used to check if the rollback is completed successfully. // If the validation is completed successfully, the plugin should return a OK result. @@ -212,19 +213,19 @@ 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) (*RolloutPluginResponse, error) { +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) (*RolloutPluginResponse, error) { +func (UnimplementedRolloutPluginServiceServer) ProgressRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollout not implemented") } func (UnimplementedRolloutPluginServiceServer) ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateRollout not implemented") } -func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { +func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method BeginRollback not implemented") } -func (UnimplementedRolloutPluginServiceServer) ProgressRollback(context.Context, *RolloutPluginRequest) (*RolloutPluginResponse, error) { +func (UnimplementedRolloutPluginServiceServer) ProgressRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollback not implemented") } func (UnimplementedRolloutPluginServiceServer) ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { From a177035128d61cca7d3f587aa3b771f77c4f01c9 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Tue, 28 Oct 2025 11:58:30 -0700 Subject: [PATCH 6/9] fix cr --- pkg/plugin/proto/v1alpha1/rollout.pb.go | 18 ++--- pkg/plugin/proto/v1alpha1/rollout.proto | 12 +-- pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go | 80 ++++++++++---------- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/pkg/plugin/proto/v1alpha1/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go index 4785930c..3711e73a 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -851,16 +851,16 @@ const file_rollout_proto_rawDesc = "" + "\bROLLBACK\x10\x02B\x12\n" + "\x10_rollout_details\"j\n" + "\x1aMutateManifestWorkResponse\x12L\n" + - "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\x9b\t\n" + + "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\xaf\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\xa5\x01\n" + - "\x0fValidateRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12s\n" + + "\x0fProgressRollout\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xaf\x01\n" + + "\x19ValidateRolloutCompletion\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12s\n" + "\rBeginRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12v\n" + - "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xa6\x01\n" + - "\x10ValidateRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12\xb7\x01\n" + + "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xb0\x01\n" + + "\x1aValidateRollbackCompletion\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\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 ( @@ -912,18 +912,18 @@ var file_rollout_proto_depIdxs = []int32{ 2, // 14: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest 7, // 15: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest 7, // 16: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 17: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 17: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRolloutCompletion:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest 7, // 18: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest 7, // 19: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest 9, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest 3, // 22: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse 14, // 23: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:output_type -> google.protobuf.Empty 14, // 24: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:output_type -> google.protobuf.Empty - 8, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollout:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + 8, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRolloutCompletion:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse 14, // 26: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:output_type -> google.protobuf.Empty 14, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> google.protobuf.Empty - 8, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollback:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse + 8, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse 10, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse 22, // [22:30] is the sub-list for method output_type 14, // [14:22] is the sub-list for method input_type diff --git a/pkg/plugin/proto/v1alpha1/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto index 5204f0c6..67bf8630 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.proto +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -27,12 +27,12 @@ service RolloutPluginService { // The plugin can execute the rollout logic based on the feedback status changes. rpc ProgressRollout(RolloutPluginRequest) returns (google.protobuf.Empty); - // ValidateRollout is called to validate the completion of the rollout. + // 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 OK result. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - rpc ValidateRollout(RolloutPluginRequest) returns (ValidateResponse); + rpc ValidateRolloutCompletion(RolloutPluginRequest) returns (ValidateResponse); // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. @@ -43,12 +43,12 @@ service RolloutPluginService { // The plugin can execute the rollback logic based on the feedback status changes. rpc ProgressRollback(RolloutPluginRequest) returns (google.protobuf.Empty); - // ValidateRollback is called to validate the completion of the rollback. + // ValidateRollbackCompletion is called to validate the completion of the rollback. // It is used to check if the rollback is completed successfully. - // If the validation is completed successfully, the plugin should return a OK result. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - rpc ValidateRollback(RolloutPluginRequest) returns (ValidateResponse); + rpc ValidateRollbackCompletion(RolloutPluginRequest) returns (ValidateResponse); // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. diff --git a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go index 915626fb..9d18fe10 100644 --- a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -24,14 +24,14 @@ import ( 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_ValidateRollout_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateRollout" - RolloutPluginService_BeginRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/BeginRollback" - RolloutPluginService_ProgressRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ProgressRollback" - RolloutPluginService_ValidateRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateRollback" - RolloutPluginService_MutateManifestWork_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/MutateManifestWork" + 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_BeginRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/BeginRollback" + RolloutPluginService_ProgressRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ProgressRollback" + RolloutPluginService_ValidateRollbackCompletion_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateRollbackCompletion" + RolloutPluginService_MutateManifestWork_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/MutateManifestWork" ) // RolloutPluginServiceClient is the client API for RolloutPluginService service. @@ -49,12 +49,12 @@ type RolloutPluginServiceClient interface { // 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) - // ValidateRollout is called to validate the completion of the rollout. + // 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 OK result. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) + ValidateRolloutCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -62,12 +62,12 @@ type RolloutPluginServiceClient interface { // Whenever the feedbacks are updated, this method will be called. // The plugin can execute the rollback logic based on the feedback status changes. ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // ValidateRollback is called to validate the completion of the rollback. + // ValidateRollbackCompletion is called to validate the completion of the rollback. // It is used to check if the rollback is completed successfully. - // If the validation is completed successfully, the plugin should return a OK result. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) + ValidateRollbackCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. // The plugin can use this information to mutate the manifestwork resource. @@ -112,10 +112,10 @@ func (c *rolloutPluginServiceClient) ProgressRollout(ctx context.Context, in *Ro return out, nil } -func (c *rolloutPluginServiceClient) ValidateRollout(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { +func (c *rolloutPluginServiceClient) ValidateRolloutCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ValidateResponse) - err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRollout_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRolloutCompletion_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -142,10 +142,10 @@ func (c *rolloutPluginServiceClient) ProgressRollback(ctx context.Context, in *R return out, nil } -func (c *rolloutPluginServiceClient) ValidateRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { +func (c *rolloutPluginServiceClient) ValidateRollbackCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ValidateResponse) - err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRollback_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, RolloutPluginService_ValidateRollbackCompletion_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -177,12 +177,12 @@ type RolloutPluginServiceServer interface { // 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) - // ValidateRollout is called to validate the completion of the rollout. + // 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 OK result. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) + ValidateRolloutCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) @@ -190,12 +190,12 @@ type RolloutPluginServiceServer interface { // Whenever the feedbacks are updated, this method will be called. // The plugin can execute the rollback logic based on the feedback status changes. ProgressRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) - // ValidateRollback is called to validate the completion of the rollback. + // ValidateRollbackCompletion is called to validate the completion of the rollback. // It is used to check if the rollback is completed successfully. - // If the validation is completed successfully, the plugin should return a OK result. + // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) + ValidateRollbackCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. // The plugin can use this information to mutate the manifestwork resource. @@ -219,8 +219,8 @@ func (UnimplementedRolloutPluginServiceServer) BeginRollout(context.Context, *Ro func (UnimplementedRolloutPluginServiceServer) ProgressRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollout not implemented") } -func (UnimplementedRolloutPluginServiceServer) ValidateRollout(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateRollout not implemented") +func (UnimplementedRolloutPluginServiceServer) ValidateRolloutCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateRolloutCompletion not implemented") } func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method BeginRollback not implemented") @@ -228,8 +228,8 @@ func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *R func (UnimplementedRolloutPluginServiceServer) ProgressRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollback not implemented") } -func (UnimplementedRolloutPluginServiceServer) ValidateRollback(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateRollback not implemented") +func (UnimplementedRolloutPluginServiceServer) ValidateRollbackCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateRollbackCompletion not implemented") } func (UnimplementedRolloutPluginServiceServer) MutateManifestWork(context.Context, *MutateManifestWorkRequest) (*MutateManifestWorkResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MutateManifestWork not implemented") @@ -309,20 +309,20 @@ func _RolloutPluginService_ProgressRollout_Handler(srv interface{}, ctx context. return interceptor(ctx, in, info, handler) } -func _RolloutPluginService_ValidateRollout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RolloutPluginService_ValidateRolloutCompletion_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).ValidateRollout(ctx, in) + return srv.(RolloutPluginServiceServer).ValidateRolloutCompletion(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: RolloutPluginService_ValidateRollout_FullMethodName, + FullMethod: RolloutPluginService_ValidateRolloutCompletion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).ValidateRollout(ctx, req.(*RolloutPluginRequest)) + return srv.(RolloutPluginServiceServer).ValidateRolloutCompletion(ctx, req.(*RolloutPluginRequest)) } return interceptor(ctx, in, info, handler) } @@ -363,20 +363,20 @@ func _RolloutPluginService_ProgressRollback_Handler(srv interface{}, ctx context return interceptor(ctx, in, info, handler) } -func _RolloutPluginService_ValidateRollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _RolloutPluginService_ValidateRollbackCompletion_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).ValidateRollback(ctx, in) + return srv.(RolloutPluginServiceServer).ValidateRollbackCompletion(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: RolloutPluginService_ValidateRollback_FullMethodName, + FullMethod: RolloutPluginService_ValidateRollbackCompletion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).ValidateRollback(ctx, req.(*RolloutPluginRequest)) + return srv.(RolloutPluginServiceServer).ValidateRollbackCompletion(ctx, req.(*RolloutPluginRequest)) } return interceptor(ctx, in, info, handler) } @@ -419,8 +419,8 @@ var RolloutPluginService_ServiceDesc = grpc.ServiceDesc{ Handler: _RolloutPluginService_ProgressRollout_Handler, }, { - MethodName: "ValidateRollout", - Handler: _RolloutPluginService_ValidateRollout_Handler, + MethodName: "ValidateRolloutCompletion", + Handler: _RolloutPluginService_ValidateRolloutCompletion_Handler, }, { MethodName: "BeginRollback", @@ -431,8 +431,8 @@ var RolloutPluginService_ServiceDesc = grpc.ServiceDesc{ Handler: _RolloutPluginService_ProgressRollback_Handler, }, { - MethodName: "ValidateRollback", - Handler: _RolloutPluginService_ValidateRollback_Handler, + MethodName: "ValidateRollbackCompletion", + Handler: _RolloutPluginService_ValidateRollbackCompletion_Handler, }, { MethodName: "MutateManifestWork", From 7effd79436fc45481f433261d176491062209871 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Fri, 31 Oct 2025 16:57:44 -0700 Subject: [PATCH 7/9] revise the naming --- pkg/plugin/proto/v1alpha1/rollout.pb.go | 280 +++++++++++-------- pkg/plugin/proto/v1alpha1/rollout.proto | 34 ++- pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go | 24 +- 3 files changed, 197 insertions(+), 141 deletions(-) diff --git a/pkg/plugin/proto/v1alpha1/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go index 3711e73a..fc908399 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -85,7 +85,7 @@ func (x ValidateResponse_Result) Number() protoreflect.EnumNumber { // Deprecated: Use ValidateResponse_Result.Descriptor instead. func (ValidateResponse_Result) EnumDescriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{6, 0} + return file_rollout_proto_rawDescGZIP(), []int{7, 0} } type MutateManifestWorkRequest_RolloutState int32 @@ -136,7 +136,7 @@ func (x MutateManifestWorkRequest_RolloutState) Number() protoreflect.EnumNumber // Deprecated: Use MutateManifestWorkRequest_RolloutState.Descriptor instead. func (MutateManifestWorkRequest_RolloutState) EnumDescriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{7, 0} + return file_rollout_proto_rawDescGZIP(), []int{8, 0} } // InitializeRequest is the request to initialize the plugin. @@ -253,8 +253,8 @@ func (x *InitializeResponse) GetCapabilities() *InitializeResponse_Capabilities // ClusterRolloutStatus is the status of the cluster rollout. type ClusterRolloutStatus struct { state protoimpl.MessageState `protogen:"open.v1"` - // name is the name of the cluster. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // 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 status of the cluster rollout. RolloutStatus string `protobuf:"bytes,2,opt,name=rollout_status,json=rolloutStatus,proto3" json:"rollout_status,omitempty"` unknownFields protoimpl.UnknownFields @@ -291,9 +291,9 @@ func (*ClusterRolloutStatus) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{2} } -func (x *ClusterRolloutStatus) GetName() string { +func (x *ClusterRolloutStatus) GetClusterName() string { if x != nil { - return x.Name + return x.ClusterName } return "" } @@ -305,13 +305,13 @@ func (x *ClusterRolloutStatus) GetRolloutStatus() string { return "" } -// RolloutDetails is the details of the rollout. -type RolloutDetails struct { +// RolloutResult is the the current result of clusters. +type RolloutResult struct { state protoimpl.MessageState `protogen:"open.v1"` - // completed is the clusters that have been completed. - Completed []*ClusterRolloutStatus `protobuf:"bytes,1,rep,name=completed,proto3" json:"completed,omitempty"` - // in_progress is the clusters that are currently being rolled out. - InProgress []*ClusterRolloutStatus `protobuf:"bytes,2,rep,name=in_progress,json=inProgress,proto3" json:"in_progress,omitempty"` + // applied is the clusters that have been completed. + Applied []*ClusterRolloutStatus `protobuf:"bytes,1,rep,name=applied,proto3" json:"applied,omitempty"` + // to_rollout is 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 is the clusters that have timed out. TimedOut []*ClusterRolloutStatus `protobuf:"bytes,3,rep,name=timed_out,json=timedOut,proto3" json:"timed_out,omitempty"` // removed is the clusters that have been removed. @@ -322,20 +322,20 @@ type RolloutDetails struct { sizeCache protoimpl.SizeCache } -func (x *RolloutDetails) Reset() { - *x = RolloutDetails{} +func (x *RolloutResult) Reset() { + *x = RolloutResult{} mi := &file_rollout_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RolloutDetails) String() string { +func (x *RolloutResult) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RolloutDetails) ProtoMessage() {} +func (*RolloutResult) ProtoMessage() {} -func (x *RolloutDetails) ProtoReflect() protoreflect.Message { +func (x *RolloutResult) ProtoReflect() protoreflect.Message { mi := &file_rollout_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -347,40 +347,40 @@ func (x *RolloutDetails) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RolloutDetails.ProtoReflect.Descriptor instead. -func (*RolloutDetails) Descriptor() ([]byte, []int) { +// Deprecated: Use RolloutResult.ProtoReflect.Descriptor instead. +func (*RolloutResult) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{3} } -func (x *RolloutDetails) GetCompleted() []*ClusterRolloutStatus { +func (x *RolloutResult) GetApplied() []*ClusterRolloutStatus { if x != nil { - return x.Completed + return x.Applied } return nil } -func (x *RolloutDetails) GetInProgress() []*ClusterRolloutStatus { +func (x *RolloutResult) GetToRollout() []*ClusterRolloutStatus { if x != nil { - return x.InProgress + return x.ToRollout } return nil } -func (x *RolloutDetails) GetTimedOut() []*ClusterRolloutStatus { +func (x *RolloutResult) GetTimedOut() []*ClusterRolloutStatus { if x != nil { return x.TimedOut } return nil } -func (x *RolloutDetails) GetRemoved() []*ClusterRolloutStatus { +func (x *RolloutResult) GetRemoved() []*ClusterRolloutStatus { if x != nil { return x.Removed } return nil } -func (x *RolloutDetails) GetPlacementTotalClusters() int32 { +func (x *RolloutResult) GetPlacementTotalClusters() int32 { if x != nil { return x.PlacementTotalClusters } @@ -465,10 +465,10 @@ type RolloutPluginRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // metadata is the metadata of the rollout. Metadata *RolloutMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - // rollout_details is the details of the rollout. - RolloutDetails *RolloutDetails `protobuf:"bytes,7,opt,name=rollout_details,json=rolloutDetails,proto3,oneof" json:"rollout_details,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // rollout_result is the result of the rollout. + RolloutResult *RolloutResult `protobuf:"bytes,7,opt,name=rollout_result,json=rolloutResult,proto3,oneof" json:"rollout_result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *RolloutPluginRequest) Reset() { @@ -508,9 +508,55 @@ func (x *RolloutPluginRequest) GetMetadata() *RolloutMeta { return nil } -func (x *RolloutPluginRequest) GetRolloutDetails() *RolloutDetails { +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 *RolloutMeta `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() *RolloutMeta { if x != nil { - return x.RolloutDetails + return x.Metadata } return nil } @@ -531,7 +577,7 @@ type ValidateResponse struct { func (x *ValidateResponse) Reset() { *x = ValidateResponse{} - mi := &file_rollout_proto_msgTypes[6] + mi := &file_rollout_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -543,7 +589,7 @@ func (x *ValidateResponse) String() string { func (*ValidateResponse) ProtoMessage() {} func (x *ValidateResponse) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[6] + mi := &file_rollout_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -556,7 +602,7 @@ func (x *ValidateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidateResponse.ProtoReflect.Descriptor instead. func (*ValidateResponse) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{6} + return file_rollout_proto_rawDescGZIP(), []int{7} } func (x *ValidateResponse) GetResult() ValidateResponse_Result { @@ -616,8 +662,8 @@ type MutateManifestWorkRequest struct { 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 is the metadata of the rollout. Metadata *RolloutMeta `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - // rollout_details is the details of the rollout. - RolloutDetails *RolloutDetails `protobuf:"bytes,3,opt,name=rollout_details,json=rolloutDetails,proto3,oneof" json:"rollout_details,omitempty"` + // rollout_result is the result of the rollout. + RolloutResult *RolloutResult `protobuf:"bytes,3,opt,name=rollout_result,json=rolloutResult,proto3,oneof" json:"rollout_result,omitempty"` // manifestwork is the unstructured manifestwork resource. Manifestwork *runtime.Unknown `protobuf:"bytes,4,opt,name=manifestwork,proto3" json:"manifestwork,omitempty"` unknownFields protoimpl.UnknownFields @@ -626,7 +672,7 @@ type MutateManifestWorkRequest struct { func (x *MutateManifestWorkRequest) Reset() { *x = MutateManifestWorkRequest{} - mi := &file_rollout_proto_msgTypes[7] + mi := &file_rollout_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -638,7 +684,7 @@ func (x *MutateManifestWorkRequest) String() string { func (*MutateManifestWorkRequest) ProtoMessage() {} func (x *MutateManifestWorkRequest) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[7] + mi := &file_rollout_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -651,7 +697,7 @@ func (x *MutateManifestWorkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MutateManifestWorkRequest.ProtoReflect.Descriptor instead. func (*MutateManifestWorkRequest) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{7} + return file_rollout_proto_rawDescGZIP(), []int{8} } func (x *MutateManifestWorkRequest) GetRolloutState() MutateManifestWorkRequest_RolloutState { @@ -668,9 +714,9 @@ func (x *MutateManifestWorkRequest) GetMetadata() *RolloutMeta { return nil } -func (x *MutateManifestWorkRequest) GetRolloutDetails() *RolloutDetails { +func (x *MutateManifestWorkRequest) GetRolloutResult() *RolloutResult { if x != nil { - return x.RolloutDetails + return x.RolloutResult } return nil } @@ -693,7 +739,7 @@ type MutateManifestWorkResponse struct { func (x *MutateManifestWorkResponse) Reset() { *x = MutateManifestWorkResponse{} - mi := &file_rollout_proto_msgTypes[8] + mi := &file_rollout_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -705,7 +751,7 @@ func (x *MutateManifestWorkResponse) String() string { func (*MutateManifestWorkResponse) ProtoMessage() {} func (x *MutateManifestWorkResponse) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[8] + mi := &file_rollout_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -718,7 +764,7 @@ func (x *MutateManifestWorkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MutateManifestWorkResponse.ProtoReflect.Descriptor instead. func (*MutateManifestWorkResponse) Descriptor() ([]byte, []int) { - return file_rollout_proto_rawDescGZIP(), []int{8} + return file_rollout_proto_rawDescGZIP(), []int{9} } func (x *MutateManifestWorkResponse) GetManifestwork() *runtime.Unknown { @@ -742,7 +788,7 @@ type InitializeResponse_Capabilities struct { func (x *InitializeResponse_Capabilities) Reset() { *x = InitializeResponse_Capabilities{} - mi := &file_rollout_proto_msgTypes[9] + mi := &file_rollout_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -754,7 +800,7 @@ func (x *InitializeResponse_Capabilities) String() string { func (*InitializeResponse_Capabilities) ProtoMessage() {} func (x *InitializeResponse_Capabilities) ProtoReflect() protoreflect.Message { - mi := &file_rollout_proto_msgTypes[9] + mi := &file_rollout_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -806,14 +852,14 @@ const file_rollout_proto_rawDesc = "" + "\fCapabilities\x12\x18\n" + "\arollout\x18\x01 \x01(\bR\arollout\x12\x1a\n" + "\brollback\x18\x02 \x01(\bR\brollback\x12/\n" + - "\x13mutate_manifestwork\x18\x03 \x01(\bR\x12mutateManifestwork\"Q\n" + - "\x14ClusterRolloutStatus\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12%\n" + - "\x0erollout_status\x18\x02 \x01(\tR\rrolloutStatus\"\xf0\x03\n" + - "\x0eRolloutDetails\x12h\n" + - "\tcompleted\x18\x01 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\tcompleted\x12k\n" + - "\vin_progress\x18\x02 \x03(\v2J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatusR\n" + - "inProgress\x12g\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\"\xa8\x01\n" + @@ -822,11 +868,13 @@ const file_rollout_proto_rawDesc = "" + "\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" + + "\r_cluster_name\"\xf9\x01\n" + "\x14RolloutPluginRequest\x12]\n" + - "\bmetadata\x18\x01 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12r\n" + - "\x0frollout_details\x18\a \x01(\v2D.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01B\x12\n" + - "\x10_rollout_details\"\xa4\x02\n" + + "\bmetadata\x18\x01 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12o\n" + + "\x0erollout_result\x18\a \x01(\v2C.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResultH\x00R\rrolloutResult\x88\x01\x01B\x11\n" + + "\x0f_rollout_result\"z\n" + + "\x19ValidateCompletionRequest\x12]\n" + + "\bmetadata\x18\x01 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\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" + @@ -839,28 +887,28 @@ const file_rollout_proto_rawDesc = "" + "\x06FAILED\x10\x02\x12\x0e\n" + "\n" + "INPROGRESS\x10\x03B\x06\n" + - "\x04data\"\x9e\x04\n" + + "\x04data\"\x9a\x04\n" + "\x19MutateManifestWorkRequest\x12\x81\x01\n" + "\rrollout_state\x18\x01 \x01(\x0e2\\.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutStateR\frolloutState\x12]\n" + - "\bmetadata\x18\x02 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12r\n" + - "\x0frollout_details\x18\x03 \x01(\v2D.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetailsH\x00R\x0erolloutDetails\x88\x01\x01\x12L\n" + + "\bmetadata\x18\x02 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\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\"H\n" + "\fRolloutState\x12\x1d\n" + "\x19ROLLOUT_STATE_UNSPECIFIED\x10\x00\x12\v\n" + "\aROLLOUT\x10\x01\x12\f\n" + - "\bROLLBACK\x10\x02B\x12\n" + - "\x10_rollout_details\"j\n" + + "\bROLLBACK\x10\x02B\x11\n" + + "\x0f_rollout_result\"j\n" + "\x1aMutateManifestWorkResponse\x12L\n" + - "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\xaf\t\n" + + "\fmanifestwork\x18\x01 \x01(\v2(.k8s.io.apimachinery.pkg.runtime.UnknownR\fmanifestwork2\xb9\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\xaf\x01\n" + - "\x19ValidateRolloutCompletion\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12s\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\x12s\n" + "\rBeginRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12v\n" + - "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xb0\x01\n" + - "\x1aValidateRollbackCompletion\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12\xb7\x01\n" + + "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xb5\x01\n" + + "\x1aValidateRollbackCompletion\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 ( @@ -876,60 +924,62 @@ func file_rollout_proto_rawDescGZIP() []byte { } var file_rollout_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_rollout_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +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 - (*RolloutDetails)(nil), // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails + (*RolloutResult)(nil), // 5: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResult (*RolloutMeta)(nil), // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta (*RolloutPluginRequest)(nil), // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - (*ValidateResponse)(nil), // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse - (*MutateManifestWorkRequest)(nil), // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest - (*MutateManifestWorkResponse)(nil), // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse - (*InitializeResponse_Capabilities)(nil), // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse.Capabilities - (*anypb.Any)(nil), // 12: google.protobuf.Any - (*runtime.Unknown)(nil), // 13: k8s.io.apimachinery.pkg.runtime.Unknown - (*emptypb.Empty)(nil), // 14: google.protobuf.Empty + (*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{ - 11, // 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.RolloutDetails.completed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - 4, // 2: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.in_progress:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - 4, // 3: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.timed_out:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus - 4, // 4: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails.removed:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ClusterRolloutStatus + 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.RolloutMeta - 5, // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails - 0, // 7: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.result:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.Result - 12, // 8: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse.proto_data:type_name -> google.protobuf.Any - 1, // 9: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_state:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.RolloutState - 6, // 10: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.metadata:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta - 5, // 11: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.rollout_details:type_name -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutDetails - 13, // 12: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown - 13, // 13: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse.manifestwork:type_name -> k8s.io.apimachinery.pkg.runtime.Unknown - 2, // 14: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeRequest - 7, // 15: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 16: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 17: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRolloutCompletion:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 18: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 19: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 9, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkRequest - 3, // 22: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.Initialize:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.InitializeResponse - 14, // 23: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollout:output_type -> google.protobuf.Empty - 14, // 24: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollout:output_type -> google.protobuf.Empty - 8, // 25: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRolloutCompletion:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse - 14, // 26: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.BeginRollback:output_type -> google.protobuf.Empty - 14, // 27: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> google.protobuf.Empty - 8, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse - 10, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.MutateManifestWork:output_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.MutateManifestWorkResponse - 22, // [22:30] is the sub-list for method output_type - 14, // [14:22] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 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.RolloutMeta + 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.RolloutMeta + 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.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 7, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest + 8, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion: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.BeginRollback:output_type -> google.protobuf.Empty + 15, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> google.protobuf.Empty + 9, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion: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() } @@ -939,18 +989,18 @@ func file_rollout_proto_init() { } file_rollout_proto_msgTypes[4].OneofWrappers = []any{} file_rollout_proto_msgTypes[5].OneofWrappers = []any{} - file_rollout_proto_msgTypes[6].OneofWrappers = []any{ + file_rollout_proto_msgTypes[7].OneofWrappers = []any{ (*ValidateResponse_TextData)(nil), (*ValidateResponse_ProtoData)(nil), } - file_rollout_proto_msgTypes[7].OneofWrappers = []any{} + 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: 10, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/plugin/proto/v1alpha1/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto index 67bf8630..4fcf4b0d 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.proto +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -32,7 +32,7 @@ service RolloutPluginService { // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - rpc ValidateRolloutCompletion(RolloutPluginRequest) returns (ValidateResponse); + rpc ValidateRolloutCompletion(ValidateCompletionRequest) returns (ValidateResponse); // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. @@ -48,7 +48,7 @@ service RolloutPluginService { // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - rpc ValidateRollbackCompletion(RolloutPluginRequest) returns (ValidateResponse); + rpc ValidateRollbackCompletion(ValidateCompletionRequest) returns (ValidateResponse); // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. @@ -87,20 +87,20 @@ message InitializeResponse { // ClusterRolloutStatus is the status of the cluster rollout. message ClusterRolloutStatus { - // name is the name of the cluster. - string name = 1; + // cluster_name is the name of the cluster. + string cluster_name = 1; // rollout_status is the status of the cluster rollout. string rollout_status = 2; } -// RolloutDetails is the details of the rollout. -message RolloutDetails { - // completed is the clusters that have been completed. - repeated ClusterRolloutStatus completed = 1; +// RolloutResult is the the current result of clusters. +message RolloutResult { + // applied is the clusters that have been completed. + repeated ClusterRolloutStatus applied = 1; - // in_progress is the clusters that are currently being rolled out. - repeated ClusterRolloutStatus in_progress = 2; + // to_rollout is the clusters that are currently being rolled out. + repeated ClusterRolloutStatus to_rollout = 2; // timed_out is the clusters that have timed out. repeated ClusterRolloutStatus timed_out = 3; @@ -132,8 +132,14 @@ message RolloutPluginRequest { // metadata is the metadata of the rollout. RolloutMeta metadata = 1; - // rollout_details is the details of the rollout. - optional RolloutDetails rollout_details = 7; + // rollout_result is the result of the rollout. + optional RolloutResult rollout_result = 7; +} + +// ValidateCompletionRequest is the request to validate the completion of the rollout. +message ValidateCompletionRequest { + // metadata is the metadata of the rollout. + RolloutMeta metadata = 1; } // ValidateResponse is the response from the plugin for the validation of the rollout. @@ -186,8 +192,8 @@ message MutateManifestWorkRequest { // metadata is the metadata of the rollout. RolloutMeta metadata = 2; - // rollout_details is the details of the rollout. - optional RolloutDetails rollout_details = 3; + // rollout_result is the result of the rollout. + optional RolloutResult rollout_result = 3; // manifestwork is the unstructured manifestwork resource. k8s.io.apimachinery.pkg.runtime.Unknown manifestwork = 4; diff --git a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go index 9d18fe10..91e7fabd 100644 --- a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -54,7 +54,7 @@ type RolloutPluginServiceClient interface { // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRolloutCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) + ValidateRolloutCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -67,7 +67,7 @@ type RolloutPluginServiceClient interface { // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollbackCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) + ValidateRollbackCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. // The plugin can use this information to mutate the manifestwork resource. @@ -112,7 +112,7 @@ func (c *rolloutPluginServiceClient) ProgressRollout(ctx context.Context, in *Ro return out, nil } -func (c *rolloutPluginServiceClient) ValidateRolloutCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { +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...) @@ -142,7 +142,7 @@ func (c *rolloutPluginServiceClient) ProgressRollback(ctx context.Context, in *R return out, nil } -func (c *rolloutPluginServiceClient) ValidateRollbackCompletion(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { +func (c *rolloutPluginServiceClient) ValidateRollbackCompletion(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_ValidateRollbackCompletion_FullMethodName, in, out, cOpts...) @@ -182,7 +182,7 @@ type RolloutPluginServiceServer interface { // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRolloutCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) + ValidateRolloutCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) // BeginRollback is called before the manifestwork resource is rolled back. // It is used to prepare the rollback. BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) @@ -195,7 +195,7 @@ type RolloutPluginServiceServer interface { // If the validation is completed successfully, the plugin should return a SUCCEEDED result. // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollbackCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) + ValidateRollbackCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. // MWRS controller provides the current rollout status to the plugin. // The plugin can use this information to mutate the manifestwork resource. @@ -219,7 +219,7 @@ func (UnimplementedRolloutPluginServiceServer) BeginRollout(context.Context, *Ro func (UnimplementedRolloutPluginServiceServer) ProgressRollout(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollout not implemented") } -func (UnimplementedRolloutPluginServiceServer) ValidateRolloutCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { +func (UnimplementedRolloutPluginServiceServer) ValidateRolloutCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateRolloutCompletion not implemented") } func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { @@ -228,7 +228,7 @@ func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *R func (UnimplementedRolloutPluginServiceServer) ProgressRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method ProgressRollback not implemented") } -func (UnimplementedRolloutPluginServiceServer) ValidateRollbackCompletion(context.Context, *RolloutPluginRequest) (*ValidateResponse, error) { +func (UnimplementedRolloutPluginServiceServer) ValidateRollbackCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateRollbackCompletion not implemented") } func (UnimplementedRolloutPluginServiceServer) MutateManifestWork(context.Context, *MutateManifestWorkRequest) (*MutateManifestWorkResponse, error) { @@ -310,7 +310,7 @@ func _RolloutPluginService_ProgressRollout_Handler(srv interface{}, ctx context. } func _RolloutPluginService_ValidateRolloutCompletion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RolloutPluginRequest) + in := new(ValidateCompletionRequest) if err := dec(in); err != nil { return nil, err } @@ -322,7 +322,7 @@ func _RolloutPluginService_ValidateRolloutCompletion_Handler(srv interface{}, ct FullMethod: RolloutPluginService_ValidateRolloutCompletion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).ValidateRolloutCompletion(ctx, req.(*RolloutPluginRequest)) + return srv.(RolloutPluginServiceServer).ValidateRolloutCompletion(ctx, req.(*ValidateCompletionRequest)) } return interceptor(ctx, in, info, handler) } @@ -364,7 +364,7 @@ func _RolloutPluginService_ProgressRollback_Handler(srv interface{}, ctx context } func _RolloutPluginService_ValidateRollbackCompletion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RolloutPluginRequest) + in := new(ValidateCompletionRequest) if err := dec(in); err != nil { return nil, err } @@ -376,7 +376,7 @@ func _RolloutPluginService_ValidateRollbackCompletion_Handler(srv interface{}, c FullMethod: RolloutPluginService_ValidateRollbackCompletion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).ValidateRollbackCompletion(ctx, req.(*RolloutPluginRequest)) + return srv.(RolloutPluginServiceServer).ValidateRollbackCompletion(ctx, req.(*ValidateCompletionRequest)) } return interceptor(ctx, in, info, handler) } From d81dd3776546c606cbaaef346b59915e0bbd441b Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Sun, 16 Nov 2025 22:34:41 -0800 Subject: [PATCH 8/9] updated --- pkg/plugin/proto/v1alpha1/rollout.pb.go | 109 +++++++++--------- pkg/plugin/proto/v1alpha1/rollout.proto | 34 +++--- pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go | 112 +++++++++---------- 3 files changed, 128 insertions(+), 127 deletions(-) diff --git a/pkg/plugin/proto/v1alpha1/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go index fc908399..054f6067 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -94,8 +94,8 @@ const ( MutateManifestWorkRequest_ROLLOUT_STATE_UNSPECIFIED MutateManifestWorkRequest_RolloutState = 0 // ROLLOUT is the rollout state for the rollout. MutateManifestWorkRequest_ROLLOUT MutateManifestWorkRequest_RolloutState = 1 - // ROLLBACK is the rollout state for the rollback. - MutateManifestWorkRequest_ROLLBACK MutateManifestWorkRequest_RolloutState = 2 + // ABORT is the rollout state for the abort. + MutateManifestWorkRequest_ABORT MutateManifestWorkRequest_RolloutState = 2 ) // Enum value maps for MutateManifestWorkRequest_RolloutState. @@ -103,12 +103,12 @@ var ( MutateManifestWorkRequest_RolloutState_name = map[int32]string{ 0: "ROLLOUT_STATE_UNSPECIFIED", 1: "ROLLOUT", - 2: "ROLLBACK", + 2: "ABORT", } MutateManifestWorkRequest_RolloutState_value = map[string]int32{ "ROLLOUT_STATE_UNSPECIFIED": 0, "ROLLOUT": 1, - "ROLLBACK": 2, + "ABORT": 2, } ) @@ -387,8 +387,8 @@ func (x *RolloutResult) GetPlacementTotalClusters() int32 { return 0 } -// RolloutMeta is the metadata of the rollout. -type RolloutMeta struct { +// RolloutMetadata is 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"` @@ -402,20 +402,20 @@ type RolloutMeta struct { sizeCache protoimpl.SizeCache } -func (x *RolloutMeta) Reset() { - *x = RolloutMeta{} +func (x *RolloutMetadata) Reset() { + *x = RolloutMetadata{} mi := &file_rollout_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RolloutMeta) String() string { +func (x *RolloutMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RolloutMeta) ProtoMessage() {} +func (*RolloutMetadata) ProtoMessage() {} -func (x *RolloutMeta) ProtoReflect() protoreflect.Message { +func (x *RolloutMetadata) ProtoReflect() protoreflect.Message { mi := &file_rollout_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -427,33 +427,33 @@ func (x *RolloutMeta) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RolloutMeta.ProtoReflect.Descriptor instead. -func (*RolloutMeta) Descriptor() ([]byte, []int) { +// Deprecated: Use RolloutMetadata.ProtoReflect.Descriptor instead. +func (*RolloutMetadata) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{4} } -func (x *RolloutMeta) GetMwrsName() string { +func (x *RolloutMetadata) GetMwrsName() string { if x != nil { return x.MwrsName } return "" } -func (x *RolloutMeta) GetPlacementName() string { +func (x *RolloutMetadata) GetPlacementName() string { if x != nil { return x.PlacementName } return "" } -func (x *RolloutMeta) GetNamespace() string { +func (x *RolloutMetadata) GetNamespace() string { if x != nil { return x.Namespace } return "" } -func (x *RolloutMeta) GetClusterName() string { +func (x *RolloutMetadata) GetClusterName() string { if x != nil && x.ClusterName != nil { return *x.ClusterName } @@ -464,9 +464,9 @@ func (x *RolloutMeta) GetClusterName() string { type RolloutPluginRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // metadata is the metadata of the rollout. - Metadata *RolloutMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *RolloutMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // rollout_result is the result of the rollout. - RolloutResult *RolloutResult `protobuf:"bytes,7,opt,name=rollout_result,json=rolloutResult,proto3,oneof" json:"rollout_result,omitempty"` + RolloutResult *RolloutResult `protobuf:"bytes,2,opt,name=rollout_result,json=rolloutResult,proto3,oneof" json:"rollout_result,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -501,7 +501,7 @@ func (*RolloutPluginRequest) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{5} } -func (x *RolloutPluginRequest) GetMetadata() *RolloutMeta { +func (x *RolloutPluginRequest) GetMetadata() *RolloutMetadata { if x != nil { return x.Metadata } @@ -519,7 +519,7 @@ func (x *RolloutPluginRequest) GetRolloutResult() *RolloutResult { type ValidateCompletionRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // metadata is the metadata of the rollout. - Metadata *RolloutMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *RolloutMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -554,7 +554,7 @@ func (*ValidateCompletionRequest) Descriptor() ([]byte, []int) { return file_rollout_proto_rawDescGZIP(), []int{6} } -func (x *ValidateCompletionRequest) GetMetadata() *RolloutMeta { +func (x *ValidateCompletionRequest) GetMetadata() *RolloutMetadata { if x != nil { return x.Metadata } @@ -661,7 +661,7 @@ type MutateManifestWorkRequest struct { // rollout_state is the rollout state. 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 is the metadata of the rollout. - Metadata *RolloutMeta `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata *RolloutMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // rollout_result is the result of the rollout. RolloutResult *RolloutResult `protobuf:"bytes,3,opt,name=rollout_result,json=rolloutResult,proto3,oneof" json:"rollout_result,omitempty"` // manifestwork is the unstructured manifestwork resource. @@ -707,7 +707,7 @@ func (x *MutateManifestWorkRequest) GetRolloutState() MutateManifestWorkRequest_ return MutateManifestWorkRequest_ROLLOUT_STATE_UNSPECIFIED } -func (x *MutateManifestWorkRequest) GetMetadata() *RolloutMeta { +func (x *MutateManifestWorkRequest) GetMetadata() *RolloutMetadata { if x != nil { return x.Metadata } @@ -862,19 +862,19 @@ const file_rollout_proto_rawDesc = "" + "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\"\xa8\x01\n" + - "\vRolloutMeta\x12\x1b\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\"\xf9\x01\n" + - "\x14RolloutPluginRequest\x12]\n" + - "\bmetadata\x18\x01 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12o\n" + - "\x0erollout_result\x18\a \x01(\v2C.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutResultH\x00R\rrolloutResult\x88\x01\x01B\x11\n" + - "\x0f_rollout_result\"z\n" + - "\x19ValidateCompletionRequest\x12]\n" + - "\bmetadata\x18\x01 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\"\xa4\x02\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" + @@ -887,28 +887,29 @@ const file_rollout_proto_rawDesc = "" + "\x06FAILED\x10\x02\x12\x0e\n" + "\n" + "INPROGRESS\x10\x03B\x06\n" + - "\x04data\"\x9a\x04\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\x12]\n" + - "\bmetadata\x18\x02 \x01(\v2A.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMetaR\bmetadata\x12o\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\"H\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\f\n" + - "\bROLLBACK\x10\x02B\x11\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\xb9\t\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\x12s\n" + - "\rBeginRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12v\n" + - "\x10ProgressRollback\x12J.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest\x1a\x16.google.protobuf.Empty\x12\xb5\x01\n" + - "\x1aValidateRollbackCompletion\x12O.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateCompletionRequest\x1aF.io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.ValidateResponse\x12\xb7\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 ( @@ -932,7 +933,7 @@ var file_rollout_proto_goTypes = []any{ (*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 - (*RolloutMeta)(nil), // 6: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutMeta + (*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 @@ -949,13 +950,13 @@ var file_rollout_proto_depIdxs = []int32{ 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.RolloutMeta + 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.RolloutMeta + 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.RolloutMeta + 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 @@ -963,17 +964,17 @@ var file_rollout_proto_depIdxs = []int32{ 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.BeginRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 7, // 20: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:input_type -> io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginRequest - 8, // 21: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion: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.BeginRollback:output_type -> google.protobuf.Empty - 15, // 28: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ProgressRollback:output_type -> google.protobuf.Empty - 9, // 29: io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService.ValidateRollbackCompletion: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 diff --git a/pkg/plugin/proto/v1alpha1/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto index 4fcf4b0d..3b7a0f00 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.proto +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -34,23 +34,23 @@ service RolloutPluginService { // If the validation is failed, the plugin should return a FAILED result. rpc ValidateRolloutCompletion(ValidateCompletionRequest) returns (ValidateResponse); - // BeginRollback is called before the manifestwork resource is rolled back. + // BeginAbort is called before the manifestwork resource is aborted. // It is used to prepare the rollback. - rpc BeginRollback(RolloutPluginRequest) returns (google.protobuf.Empty); + rpc BeginAbort(RolloutPluginRequest) returns (google.protobuf.Empty); - // ProgressRollback is called after the manifestwork is rolled back. + // ProgressAbort is called after the manifestwork is aborted. // Whenever the feedbacks are updated, this method will be called. - // The plugin can execute the rollback logic based on the feedback status changes. - rpc ProgressRollback(RolloutPluginRequest) returns (google.protobuf.Empty); + // The plugin can execute the abort logic based on the feedback status changes. + rpc ProgressAbort(RolloutPluginRequest) returns (google.protobuf.Empty); - // ValidateRollbackCompletion is called to validate the completion of the rollback. - // It is used to check if the rollback is completed successfully. + // 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 a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - rpc ValidateRollbackCompletion(ValidateCompletionRequest) returns (ValidateResponse); + rpc ValidateAbortCompletion(ValidateCompletionRequest) returns (ValidateResponse); - // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. + // 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); @@ -112,8 +112,8 @@ message RolloutResult { int32 placement_total_clusters = 6; } -// RolloutMeta is the metadata of the rollout. -message RolloutMeta { +// RolloutMetadata is the metadata of the rollout. +message RolloutMetadata { // mwrs_name is the name of the manifestwork resource set. string mwrs_name = 1; @@ -130,16 +130,16 @@ message RolloutMeta { // RolloutPluginRequest is the request to the rollout plugin. message RolloutPluginRequest { // metadata is the metadata of the rollout. - RolloutMeta metadata = 1; + RolloutMetadata metadata = 1; // rollout_result is the result of the rollout. - optional RolloutResult rollout_result = 7; + 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. - RolloutMeta metadata = 1; + RolloutMetadata metadata = 1; } // ValidateResponse is the response from the plugin for the validation of the rollout. @@ -182,15 +182,15 @@ message MutateManifestWorkRequest { // ROLLOUT is the rollout state for the rollout. ROLLOUT = 1; - // ROLLBACK is the rollout state for the rollback. - ROLLBACK = 2; + // ABORT is the rollout state for the abort. + ABORT = 2; } // rollout_state is the rollout state. RolloutState rollout_state = 1; // metadata is the metadata of the rollout. - RolloutMeta metadata = 2; + RolloutMetadata metadata = 2; // rollout_result is the result of the rollout. optional RolloutResult rollout_result = 3; diff --git a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go index 91e7fabd..06a393ad 100644 --- a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -24,14 +24,14 @@ import ( 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_BeginRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/BeginRollback" - RolloutPluginService_ProgressRollback_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ProgressRollback" - RolloutPluginService_ValidateRollbackCompletion_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/ValidateRollbackCompletion" - RolloutPluginService_MutateManifestWork_FullMethodName = "/io.openclustermanagement.sdkgo.plugin.proto.v1alpha1.RolloutPluginService/MutateManifestWork" + 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. @@ -55,20 +55,20 @@ type RolloutPluginServiceClient interface { // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. ValidateRolloutCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) - // BeginRollback is called before the manifestwork resource is rolled back. + // BeginAbort is called before the manifestwork resource is aborted. // It is used to prepare the rollback. - BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // ProgressRollback is called after the manifestwork is rolled back. + 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 rollback logic based on the feedback status changes. - ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // ValidateRollbackCompletion is called to validate the completion of the rollback. - // It is used to check if the rollback is completed successfully. + // 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 a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollbackCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) - // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. + 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) @@ -122,30 +122,30 @@ func (c *rolloutPluginServiceClient) ValidateRolloutCompletion(ctx context.Conte return out, nil } -func (c *rolloutPluginServiceClient) BeginRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +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_BeginRollback_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, RolloutPluginService_BeginAbort_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *rolloutPluginServiceClient) ProgressRollback(ctx context.Context, in *RolloutPluginRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +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_ProgressRollback_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, RolloutPluginService_ProgressAbort_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *rolloutPluginServiceClient) ValidateRollbackCompletion(ctx context.Context, in *ValidateCompletionRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { +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_ValidateRollbackCompletion_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, RolloutPluginService_ValidateAbortCompletion_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -183,20 +183,20 @@ type RolloutPluginServiceServer interface { // If the validation is still in progress, the plugin should return a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. ValidateRolloutCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) - // BeginRollback is called before the manifestwork resource is rolled back. + // BeginAbort is called before the manifestwork resource is aborted. // It is used to prepare the rollback. - BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) - // ProgressRollback is called after the manifestwork is rolled back. + 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 rollback logic based on the feedback status changes. - ProgressRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) - // ValidateRollbackCompletion is called to validate the completion of the rollback. - // It is used to check if the rollback is completed successfully. + // 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 a INPROGRESS result. // If the validation is failed, the plugin should return a FAILED result. - ValidateRollbackCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) - // MutateManifestWork is called to mutate the manifestwork resource before it is applied or rolled back. + 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) @@ -222,14 +222,14 @@ func (UnimplementedRolloutPluginServiceServer) ProgressRollout(context.Context, func (UnimplementedRolloutPluginServiceServer) ValidateRolloutCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateRolloutCompletion not implemented") } -func (UnimplementedRolloutPluginServiceServer) BeginRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeginRollback not implemented") +func (UnimplementedRolloutPluginServiceServer) BeginAbort(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginAbort not implemented") } -func (UnimplementedRolloutPluginServiceServer) ProgressRollback(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProgressRollback not implemented") +func (UnimplementedRolloutPluginServiceServer) ProgressAbort(context.Context, *RolloutPluginRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProgressAbort not implemented") } -func (UnimplementedRolloutPluginServiceServer) ValidateRollbackCompletion(context.Context, *ValidateCompletionRequest) (*ValidateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidateRollbackCompletion 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") @@ -327,56 +327,56 @@ func _RolloutPluginService_ValidateRolloutCompletion_Handler(srv interface{}, ct return interceptor(ctx, in, info, handler) } -func _RolloutPluginService_BeginRollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +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).BeginRollback(ctx, in) + return srv.(RolloutPluginServiceServer).BeginAbort(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: RolloutPluginService_BeginRollback_FullMethodName, + FullMethod: RolloutPluginService_BeginAbort_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).BeginRollback(ctx, req.(*RolloutPluginRequest)) + return srv.(RolloutPluginServiceServer).BeginAbort(ctx, req.(*RolloutPluginRequest)) } return interceptor(ctx, in, info, handler) } -func _RolloutPluginService_ProgressRollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +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).ProgressRollback(ctx, in) + return srv.(RolloutPluginServiceServer).ProgressAbort(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: RolloutPluginService_ProgressRollback_FullMethodName, + FullMethod: RolloutPluginService_ProgressAbort_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).ProgressRollback(ctx, req.(*RolloutPluginRequest)) + return srv.(RolloutPluginServiceServer).ProgressAbort(ctx, req.(*RolloutPluginRequest)) } return interceptor(ctx, in, info, handler) } -func _RolloutPluginService_ValidateRollbackCompletion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +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).ValidateRollbackCompletion(ctx, in) + return srv.(RolloutPluginServiceServer).ValidateAbortCompletion(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: RolloutPluginService_ValidateRollbackCompletion_FullMethodName, + FullMethod: RolloutPluginService_ValidateAbortCompletion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RolloutPluginServiceServer).ValidateRollbackCompletion(ctx, req.(*ValidateCompletionRequest)) + return srv.(RolloutPluginServiceServer).ValidateAbortCompletion(ctx, req.(*ValidateCompletionRequest)) } return interceptor(ctx, in, info, handler) } @@ -423,16 +423,16 @@ var RolloutPluginService_ServiceDesc = grpc.ServiceDesc{ Handler: _RolloutPluginService_ValidateRolloutCompletion_Handler, }, { - MethodName: "BeginRollback", - Handler: _RolloutPluginService_BeginRollback_Handler, + MethodName: "BeginAbort", + Handler: _RolloutPluginService_BeginAbort_Handler, }, { - MethodName: "ProgressRollback", - Handler: _RolloutPluginService_ProgressRollback_Handler, + MethodName: "ProgressAbort", + Handler: _RolloutPluginService_ProgressAbort_Handler, }, { - MethodName: "ValidateRollbackCompletion", - Handler: _RolloutPluginService_ValidateRollbackCompletion_Handler, + MethodName: "ValidateAbortCompletion", + Handler: _RolloutPluginService_ValidateAbortCompletion_Handler, }, { MethodName: "MutateManifestWork", From efc750891e1935a2b494b973c737c09351aa2e5f Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Sun, 16 Nov 2025 22:40:06 -0800 Subject: [PATCH 9/9] revise the comments --- pkg/plugin/proto/v1alpha1/rollout.pb.go | 70 ++++++++-------- pkg/plugin/proto/v1alpha1/rollout.proto | 84 ++++++++++---------- pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go | 24 +++--- 3 files changed, 89 insertions(+), 89 deletions(-) diff --git a/pkg/plugin/proto/v1alpha1/rollout.pb.go b/pkg/plugin/proto/v1alpha1/rollout.pb.go index 054f6067..64a4d77f 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout.pb.go @@ -28,7 +28,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Result is the result of the validation response. +// Result represents the validation result. type ValidateResponse_Result int32 const ( @@ -38,7 +38,7 @@ const ( // 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 the rollback is required. + // 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. @@ -92,9 +92,9 @@ type MutateManifestWorkRequest_RolloutState int32 const ( MutateManifestWorkRequest_ROLLOUT_STATE_UNSPECIFIED MutateManifestWorkRequest_RolloutState = 0 - // ROLLOUT is the rollout state for the rollout. + // ROLLOUT indicates the manifestwork is being rolled out. MutateManifestWorkRequest_ROLLOUT MutateManifestWorkRequest_RolloutState = 1 - // ABORT is the rollout state for the abort. + // ABORT indicates the manifestwork is being aborted. MutateManifestWorkRequest_ABORT MutateManifestWorkRequest_RolloutState = 2 ) @@ -250,12 +250,12 @@ func (x *InitializeResponse) GetCapabilities() *InitializeResponse_Capabilities return nil } -// ClusterRolloutStatus is the status of the cluster rollout. +// 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 status of the cluster rollout. + // 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 @@ -305,18 +305,18 @@ func (x *ClusterRolloutStatus) GetRolloutStatus() string { return "" } -// RolloutResult is the the current result of clusters. +// RolloutResult represents the current result of clusters in the rollout process. type RolloutResult struct { state protoimpl.MessageState `protogen:"open.v1"` - // applied is the clusters that have been completed. + // applied contains the clusters that have been successfully completed. Applied []*ClusterRolloutStatus `protobuf:"bytes,1,rep,name=applied,proto3" json:"applied,omitempty"` - // to_rollout is the clusters that are currently being rolled out. + // 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 is the clusters that have timed out. + // 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 is the clusters that have been removed. + // 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 clusters in placement decision. + // 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 @@ -387,16 +387,16 @@ func (x *RolloutResult) GetPlacementTotalClusters() int32 { return 0 } -// RolloutMetadata is the metadata of the rollout. +// 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 mwrs and placement are located. + // 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. + // 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 @@ -561,10 +561,10 @@ func (x *ValidateCompletionRequest) GetMetadata() *RolloutMetadata { return nil } -// ValidateResponse is the response from the plugin for the validation of the rollout. +// 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 result of the response. + // 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: // @@ -642,12 +642,12 @@ type isValidateResponse_Data interface { } type ValidateResponse_TextData struct { - // text_data is the text data of the response. + // 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 is the protobuf data of the response. + // proto_data contains optional protobuf data in the response. ProtoData *anypb.Any `protobuf:"bytes,3,opt,name=proto_data,json=protoData,proto3,oneof"` } @@ -655,16 +655,16 @@ func (*ValidateResponse_TextData) isValidateResponse_Data() {} func (*ValidateResponse_ProtoData) isValidateResponse_Data() {} -// MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied. +// 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 is the rollout state. + // 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 is the metadata of the rollout. + // metadata contains the metadata of the rollout. Metadata *RolloutMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - // rollout_result is the result of the rollout. + // 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. + // 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 @@ -728,7 +728,7 @@ func (x *MutateManifestWorkRequest) GetManifestwork() *runtime.Unknown { return nil } -// MutateManifestWorkResponse is the response to mutate the manifestwork resource before it is applied. +// MutateManifestWorkResponse is the response containing the mutated manifestwork resource. type MutateManifestWorkResponse struct { state protoimpl.MessageState `protogen:"open.v1"` // manifestwork is the mutated manifestwork resource. @@ -776,11 +776,11 @@ func (x *MutateManifestWorkResponse) GetManifestwork() *runtime.Unknown { type InitializeResponse_Capabilities struct { state protoimpl.MessageState `protogen:"open.v1"` - // rollout is the capability to rollout. + // rollout indicates whether the plugin supports rollout operations. Rollout bool `protobuf:"varint,1,opt,name=rollout,proto3" json:"rollout,omitempty"` - // rollback is the capability to rollback. - Rollback bool `protobuf:"varint,2,opt,name=rollback,proto3" json:"rollback,omitempty"` - // mutate_manifestwork is the capability to mutate the manifestwork resource. + // 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 @@ -823,9 +823,9 @@ func (x *InitializeResponse_Capabilities) GetRollout() bool { return false } -func (x *InitializeResponse_Capabilities) GetRollback() bool { +func (x *InitializeResponse_Capabilities) GetAbort() bool { if x != nil { - return x.Rollback + return x.Abort } return false } @@ -844,14 +844,14 @@ const file_rollout_proto_rawDesc = "" + "\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\"\xb4\x02\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\x1au\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\x1a\n" + - "\brollback\x18\x02 \x01(\bR\brollback\x12/\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" + diff --git a/pkg/plugin/proto/v1alpha1/rollout.proto b/pkg/plugin/proto/v1alpha1/rollout.proto index 3b7a0f00..490ec6d8 100644 --- a/pkg/plugin/proto/v1alpha1/rollout.proto +++ b/pkg/plugin/proto/v1alpha1/rollout.proto @@ -15,7 +15,7 @@ option go_package = "open-cluster-management.io/sdk-go/plugin/proto/v1alpha1;v1a // RolloutPluginService is the service for the rollout plugin. service RolloutPluginService { - // Initialize initializes the plugin + // Initialize initializes the plugin. rpc Initialize(InitializeRequest) returns (InitializeResponse); // BeginRollout is called before the manifestwork resource is applied. @@ -30,8 +30,8 @@ service RolloutPluginService { // 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 a INPROGRESS result. - // If the validation is failed, the plugin should return a FAILED 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. @@ -46,12 +46,12 @@ service RolloutPluginService { // 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 a INPROGRESS result. - // If the validation is failed, the plugin should return a FAILED 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. + // 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); } @@ -62,57 +62,57 @@ message InitializeRequest { string ocm_version = 1; } -// InitializeResponse is the response from the plugin after initialization. +// 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 is the capability to rollout. + // rollout indicates whether the plugin supports rollout operations. bool rollout = 1; - // rollback is the capability to rollback. - bool rollback = 2; + // abort indicates whether the plugin supports abort operations. + bool abort = 2; - // mutate_manifestwork is the capability to mutate the manifestwork resource. + // 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 is the status of the cluster rollout. +// 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 status of the cluster rollout. + // rollout_status is the current status of the cluster rollout (e.g., "succeeded", "failed", "in_progress"). string rollout_status = 2; } -// RolloutResult is the the current result of clusters. +// RolloutResult represents the current result of clusters in the rollout process. message RolloutResult { - // applied is the clusters that have been completed. + // applied contains the clusters that have been successfully completed. repeated ClusterRolloutStatus applied = 1; - // to_rollout is the clusters that are currently being rolled out. + // to_rollout contains the clusters that are currently being rolled out. repeated ClusterRolloutStatus to_rollout = 2; - - // timed_out is the clusters that have timed out. + + // timed_out contains the clusters that have timed out during the rollout. repeated ClusterRolloutStatus timed_out = 3; - - // removed is the clusters that have been removed. + + // removed contains the clusters that have been removed from the rollout. repeated ClusterRolloutStatus removed = 4; - // placement_total_clusters is the total clusters in placement decision. + // placement_total_clusters is the total number of clusters in the placement decision. int32 placement_total_clusters = 6; } -// RolloutMetadata is the metadata of the rollout. +// RolloutMetadata contains the metadata of the rollout. message RolloutMetadata { // mwrs_name is the name of the manifestwork resource set. string mwrs_name = 1; @@ -120,10 +120,10 @@ message RolloutMetadata { // placement_name is the name of the placement. string placement_name = 2; - // namespace is the namespace where mwrs and placement are located. + // namespace is the namespace where the manifestwork resource set and placement are located. string namespace = 3; - // cluster_name is the name of the cluster. + // 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; } @@ -142,64 +142,64 @@ message ValidateCompletionRequest { RolloutMetadata metadata = 1; } -// ValidateResponse is the response from the plugin for the validation of the rollout. +// ValidateResponse is the response from the plugin for the validation of the rollout or abort. message ValidateResponse { - // Result is the result of the validation response. + // 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 the rollback is required. + // 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 result of the response. + + // result is the validation result. Result result = 1; oneof data { - // text_data is the text data of the response. + // text_data contains optional text data in the response. string text_data = 2; - // proto_data is the protobuf data of the response. + // 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. +// MutateManifestWorkRequest is the request to mutate the manifestwork resource before it is applied or aborted. message MutateManifestWorkRequest { enum RolloutState { ROLLOUT_STATE_UNSPECIFIED = 0; - // ROLLOUT is the rollout state for the rollout. + // ROLLOUT indicates the manifestwork is being rolled out. ROLLOUT = 1; - // ABORT is the rollout state for the abort. + // ABORT indicates the manifestwork is being aborted. ABORT = 2; } - // rollout_state is the rollout state. + // rollout_state indicates the current state of the rollout operation. RolloutState rollout_state = 1; - // metadata is the metadata of the rollout. + // metadata contains the metadata of the rollout. RolloutMetadata metadata = 2; - // rollout_result is the result of the rollout. + // rollout_result contains the current result of the rollout. This field is optional. optional RolloutResult rollout_result = 3; - - // manifestwork is the unstructured manifestwork resource. + + // manifestwork is the unstructured manifestwork resource to be mutated. k8s.io.apimachinery.pkg.runtime.Unknown manifestwork = 4; } -// MutateManifestWorkResponse is the response to mutate the manifestwork resource before it is applied. +// 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; diff --git a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go index 06a393ad..9433571f 100644 --- a/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go +++ b/pkg/plugin/proto/v1alpha1/rollout_grpc.pb.go @@ -40,7 +40,7 @@ const ( // // RolloutPluginService is the service for the rollout plugin. type RolloutPluginServiceClient interface { - // Initialize initializes the plugin + // 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. @@ -52,8 +52,8 @@ type RolloutPluginServiceClient interface { // 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 a INPROGRESS result. - // If the validation is failed, the plugin should return a FAILED 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. @@ -65,11 +65,11 @@ type RolloutPluginServiceClient interface { // 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 a INPROGRESS result. - // If the validation is failed, the plugin should return a FAILED 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. + // 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) } @@ -168,7 +168,7 @@ func (c *rolloutPluginServiceClient) MutateManifestWork(ctx context.Context, in // // RolloutPluginService is the service for the rollout plugin. type RolloutPluginServiceServer interface { - // Initialize initializes the plugin + // 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. @@ -180,8 +180,8 @@ type RolloutPluginServiceServer interface { // 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 a INPROGRESS result. - // If the validation is failed, the plugin should return a FAILED 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. @@ -193,11 +193,11 @@ type RolloutPluginServiceServer interface { // 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 a INPROGRESS result. - // If the validation is failed, the plugin should return a FAILED 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. + // 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()