diff --git a/.wordlist.txt b/.wordlist.txt index 8255326..b7751ce 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -6,19 +6,13 @@ BackupCapabilitiesResult BackupCapability BackupRequest BackupResult -bignum -bool -boolean ByteString CloudNativePG -cncf -cnpg -csi -customizable -customizations -edb +DEREGISTER +Deregister +DeregisterRequest +DeregisterResponse FalseClass -fixnum GetCapabilities GetPluginCapabilities GetPluginCapabilitiesRequest @@ -26,17 +20,11 @@ GetPluginCapabilitiesResponse GetPluginMetadata GetPluginMetadataRequest GetPluginMetadataResponse -gRPC -html -https -ietf -json JSONPatch kube kubernetes lifecycle LifecycleHook -lsn ManifestEntry MetadataEntry MutateCluster @@ -58,15 +46,12 @@ OperatorValidateClusterChangeResult OperatorValidateClusterCreateRequest OperatorValidateClusterCreateResult ParametersEntry -pluggable PluginCapability -pluginName -postgres Pre ProbeRequest ProbeResponse -proto -reconciler +RPC +RPCs ReconcilerHooks ReconcilerHooksCapabilitiesRequest ReconcilerHooksCapabilitiesResult @@ -86,22 +71,11 @@ SetClusterStatusResponse SetFirstRequired SetFirstRequiredRequest SetFirstRequiredResult -sfixed -sint -slonik -str -tablespace TrueClass -uint -ulong -unicode -url -utf ValidateClusterChange ValidateClusterCreate ValidateCreate ValidationError -wal WALArchiveRequest WALArchiveResult WALCapabilitiesRequest @@ -112,4 +86,43 @@ WALRestoreResult WALService WALStatusRequest WALStatusResult +alphanumerics +bignum +bool +boolean +cncf +cnpg +csi +customizable +customizations +edb +fixnum +gRPC +html +https +ietf +json +kubernetes +lifecycle +lsn +pluggable +pluginName +postgres +proto +reconciler +reconcilers +requeue +rfc +rpc +sfixed +sint +slonik +str +tablespace +uint +ulong +unicode +url +utf +wal webhook diff --git a/docs/docs.md b/docs/docs.md index ced832a..31c2ddb 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -33,6 +33,8 @@ - [Identity](#cnpgi-identity-v1-Identity) - [operator.proto](#operator-proto) + - [DeregisterRequest](#cnpgi-operator-v1-DeregisterRequest) + - [DeregisterResponse](#cnpgi-operator-v1-DeregisterResponse) - [OperatorCapabilitiesRequest](#cnpgi-operator-v1-OperatorCapabilitiesRequest) - [OperatorCapabilitiesResult](#cnpgi-operator-v1-OperatorCapabilitiesResult) - [OperatorCapability](#cnpgi-operator-v1-OperatorCapability) @@ -452,6 +454,31 @@ Intentionally empty. + + +### DeregisterRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| definition | [bytes](#bytes) | | This field is REQUIRED. Value of this field is the JSON serialization of the Cluster that should receive the default values | + + + + + + + + +### DeregisterResponse + + + + + + + ### OperatorCapabilitiesRequest @@ -659,6 +686,7 @@ Intentionally empty. | TYPE_VALIDATE_CLUSTER_CHANGE | 2 | TYPE_VALIDATE_CLUSTER_CHANGE indicates that the Plugin is able to reply to the ValidateClusterChange RPC request | | TYPE_MUTATE_CLUSTER | 3 | TYPE_MUTATE_CLUSTER indicates that the Plugin is able to reply to the MutateCluster RPC request | | TYPE_SET_CLUSTER_STATUS | 5 | TYPE_SET_CLUSTER_STATUS indicates that the Plugin is able to set cluster status | +| TYPE_DEREGISTER | 6 | TYPE_DEREGISTER indicates that the Plugin is able to execute the cleanup logic once it is removed from the cluster definition | @@ -678,6 +706,7 @@ Intentionally empty. | ValidateClusterChange | [OperatorValidateClusterChangeRequest](#cnpgi-operator-v1-OperatorValidateClusterChangeRequest) | [OperatorValidateClusterChangeResult](#cnpgi-operator-v1-OperatorValidateClusterChangeResult) | ValidateClusterChange improves the behavior of the validating webhook of is called on updates of the Cluster resources | | MutateCluster | [OperatorMutateClusterRequest](#cnpgi-operator-v1-OperatorMutateClusterRequest) | [OperatorMutateClusterResult](#cnpgi-operator-v1-OperatorMutateClusterResult) | MutateCluster fills in the defaults inside a Cluster resource | | SetClusterStatus | [SetClusterStatusRequest](#cnpgi-operator-v1-SetClusterStatusRequest) | [SetClusterStatusResponse](#cnpgi-operator-v1-SetClusterStatusResponse) | SetClusterStatus is invoked at the end of the reconciliation loop and it is used to set the plugin status inside the .status.plugins[pluginName] map key | +| Deregister | [DeregisterRequest](#cnpgi-operator-v1-DeregisterRequest) | [DeregisterResponse](#cnpgi-operator-v1-DeregisterResponse) | Deregister is invoked when the plugin is removed from the cluster definition. It is expected that the plugin executes its cleanup logic when this method is invoked. | @@ -793,6 +822,7 @@ The operator type corresponds to the Kubernetes API method | TYPE_UPDATE | 2 | | | TYPE_CREATE | 3 | | | TYPE_DELETE | 4 | | +| TYPE_DEREGISTER | 5 | | diff --git a/pkg/lifecycle/operator_lifecycle.pb.go b/pkg/lifecycle/operator_lifecycle.pb.go index 814a740..dca5e8b 100644 --- a/pkg/lifecycle/operator_lifecycle.pb.go +++ b/pkg/lifecycle/operator_lifecycle.pb.go @@ -29,6 +29,7 @@ const ( OperatorOperationType_TYPE_UPDATE OperatorOperationType_Type = 2 OperatorOperationType_TYPE_CREATE OperatorOperationType_Type = 3 OperatorOperationType_TYPE_DELETE OperatorOperationType_Type = 4 + OperatorOperationType_TYPE_DEREGISTER OperatorOperationType_Type = 5 ) // Enum value maps for OperatorOperationType_Type. @@ -39,6 +40,7 @@ var ( 2: "TYPE_UPDATE", 3: "TYPE_CREATE", 4: "TYPE_DELETE", + 5: "TYPE_DEREGISTER", } OperatorOperationType_Type_value = map[string]int32{ "TYPE_UNSPECIFIED": 0, @@ -46,6 +48,7 @@ var ( "TYPE_UPDATE": 2, "TYPE_CREATE": 3, "TYPE_DELETE": 4, + "TYPE_DEREGISTER": 5, } ) @@ -419,60 +422,61 @@ var file_proto_operator_lifecycle_proto_rawDesc = []byte{ 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0xc5, 0x01, 0x0a, 0x15, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0xda, 0x01, 0x0a, 0x15, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x22, 0x5f, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, + 0x70, 0x65, 0x22, 0x74, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x41, 0x54, 0x43, 0x48, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, - 0x45, 0x10, 0x04, 0x22, 0xd1, 0x01, 0x0a, 0x18, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x59, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, - 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, - 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x65, 0x66, - 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x0a, 0x19, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, - 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x61, - 0x74, 0x63, 0x68, 0x32, 0xb3, 0x02, 0x0a, 0x11, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x9a, 0x01, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x41, 0x2e, + 0x45, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x52, 0x45, + 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, 0x10, 0x05, 0x22, 0xd1, 0x01, 0x0a, 0x18, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x59, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x43, 0x61, 0x70, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x42, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, - 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x66, 0x65, 0x63, - 0x79, 0x63, 0x6c, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x35, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, - 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, - 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, - 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x36, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6e, 0x61, 0x74, - 0x69, 0x76, 0x65, 0x2d, 0x70, 0x67, 0x2f, 0x63, 0x6e, 0x70, 0x67, 0x2d, 0x69, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x61, 0x74, 0x6f, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2b, 0x0a, 0x11, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x0a, 0x19, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, + 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6a, + 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x32, 0xb3, 0x02, 0x0a, 0x11, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x9a, + 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x12, 0x41, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, + 0x6c, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x80, 0x01, 0x0a, 0x0d, + 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x35, 0x2e, + 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, + 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x30, + 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2d, 0x70, 0x67, 0x2f, 0x63, 0x6e, 0x70, 0x67, + 0x2d, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/operator/operator.pb.go b/pkg/operator/operator.pb.go index 45f7264..1ee99d4 100644 --- a/pkg/operator/operator.pb.go +++ b/pkg/operator/operator.pb.go @@ -36,6 +36,9 @@ const ( // TYPE_SET_CLUSTER_STATUS indicates that the Plugin is able to // set cluster status OperatorCapability_RPC_TYPE_SET_CLUSTER_STATUS OperatorCapability_RPC_Type = 5 + // TYPE_DEREGISTER indicates that the Plugin is able to execute the cleanup logic once it is removed from + // the cluster definition + OperatorCapability_RPC_TYPE_DEREGISTER OperatorCapability_RPC_Type = 6 ) // Enum value maps for OperatorCapability_RPC_Type. @@ -46,6 +49,7 @@ var ( 2: "TYPE_VALIDATE_CLUSTER_CHANGE", 3: "TYPE_MUTATE_CLUSTER", 5: "TYPE_SET_CLUSTER_STATUS", + 6: "TYPE_DEREGISTER", } OperatorCapability_RPC_Type_value = map[string]int32{ "TYPE_UNSPECIFIED": 0, @@ -53,6 +57,7 @@ var ( "TYPE_VALIDATE_CLUSTER_CHANGE": 2, "TYPE_MUTATE_CLUSTER": 3, "TYPE_SET_CLUSTER_STATUS": 5, + "TYPE_DEREGISTER": 6, } ) @@ -80,7 +85,7 @@ func (x OperatorCapability_RPC_Type) Number() protoreflect.EnumNumber { // Deprecated: Use OperatorCapability_RPC_Type.Descriptor instead. func (OperatorCapability_RPC_Type) EnumDescriptor() ([]byte, []int) { - return file_proto_operator_proto_rawDescGZIP(), []int{9, 0, 0} + return file_proto_operator_proto_rawDescGZIP(), []int{11, 0, 0} } type OperatorCapabilitiesRequest struct { @@ -426,6 +431,94 @@ func (x *OperatorMutateClusterRequest) GetDefinition() []byte { return nil } +type DeregisterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field is REQUIRED. Value of this field is the JSON + // serialization of the Cluster that should receive the + // default values + Definition []byte `protobuf:"bytes,1,opt,name=definition,proto3" json:"definition,omitempty"` +} + +func (x *DeregisterRequest) Reset() { + *x = DeregisterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_operator_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeregisterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeregisterRequest) ProtoMessage() {} + +func (x *DeregisterRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_operator_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeregisterRequest.ProtoReflect.Descriptor instead. +func (*DeregisterRequest) Descriptor() ([]byte, []int) { + return file_proto_operator_proto_rawDescGZIP(), []int{7} +} + +func (x *DeregisterRequest) GetDefinition() []byte { + if x != nil { + return x.Definition + } + return nil +} + +type DeregisterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeregisterResponse) Reset() { + *x = DeregisterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_operator_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeregisterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeregisterResponse) ProtoMessage() {} + +func (x *DeregisterResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_operator_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeregisterResponse.ProtoReflect.Descriptor instead. +func (*DeregisterResponse) Descriptor() ([]byte, []int) { + return file_proto_operator_proto_rawDescGZIP(), []int{8} +} + type OperatorMutateClusterResult struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -439,7 +532,7 @@ type OperatorMutateClusterResult struct { func (x *OperatorMutateClusterResult) Reset() { *x = OperatorMutateClusterResult{} if protoimpl.UnsafeEnabled { - mi := &file_proto_operator_proto_msgTypes[7] + mi := &file_proto_operator_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -452,7 +545,7 @@ func (x *OperatorMutateClusterResult) String() string { func (*OperatorMutateClusterResult) ProtoMessage() {} func (x *OperatorMutateClusterResult) ProtoReflect() protoreflect.Message { - mi := &file_proto_operator_proto_msgTypes[7] + mi := &file_proto_operator_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -465,7 +558,7 @@ func (x *OperatorMutateClusterResult) ProtoReflect() protoreflect.Message { // Deprecated: Use OperatorMutateClusterResult.ProtoReflect.Descriptor instead. func (*OperatorMutateClusterResult) Descriptor() ([]byte, []int) { - return file_proto_operator_proto_rawDescGZIP(), []int{7} + return file_proto_operator_proto_rawDescGZIP(), []int{9} } func (x *OperatorMutateClusterResult) GetJsonPatch() []byte { @@ -493,7 +586,7 @@ type ValidationError struct { func (x *ValidationError) Reset() { *x = ValidationError{} if protoimpl.UnsafeEnabled { - mi := &file_proto_operator_proto_msgTypes[8] + mi := &file_proto_operator_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -506,7 +599,7 @@ func (x *ValidationError) String() string { func (*ValidationError) ProtoMessage() {} func (x *ValidationError) ProtoReflect() protoreflect.Message { - mi := &file_proto_operator_proto_msgTypes[8] + mi := &file_proto_operator_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -519,7 +612,7 @@ func (x *ValidationError) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidationError.ProtoReflect.Descriptor instead. func (*ValidationError) Descriptor() ([]byte, []int) { - return file_proto_operator_proto_rawDescGZIP(), []int{8} + return file_proto_operator_proto_rawDescGZIP(), []int{10} } func (x *ValidationError) GetPathComponents() []string { @@ -557,7 +650,7 @@ type OperatorCapability struct { func (x *OperatorCapability) Reset() { *x = OperatorCapability{} if protoimpl.UnsafeEnabled { - mi := &file_proto_operator_proto_msgTypes[9] + mi := &file_proto_operator_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -570,7 +663,7 @@ func (x *OperatorCapability) String() string { func (*OperatorCapability) ProtoMessage() {} func (x *OperatorCapability) ProtoReflect() protoreflect.Message { - mi := &file_proto_operator_proto_msgTypes[9] + mi := &file_proto_operator_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -583,7 +676,7 @@ func (x *OperatorCapability) ProtoReflect() protoreflect.Message { // Deprecated: Use OperatorCapability.ProtoReflect.Descriptor instead. func (*OperatorCapability) Descriptor() ([]byte, []int) { - return file_proto_operator_proto_rawDescGZIP(), []int{9} + return file_proto_operator_proto_rawDescGZIP(), []int{11} } func (m *OperatorCapability) GetType() isOperatorCapability_Type { @@ -623,7 +716,7 @@ type SetClusterStatusRequest struct { func (x *SetClusterStatusRequest) Reset() { *x = SetClusterStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_operator_proto_msgTypes[10] + mi := &file_proto_operator_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -636,7 +729,7 @@ func (x *SetClusterStatusRequest) String() string { func (*SetClusterStatusRequest) ProtoMessage() {} func (x *SetClusterStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_operator_proto_msgTypes[10] + mi := &file_proto_operator_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -649,7 +742,7 @@ func (x *SetClusterStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetClusterStatusRequest.ProtoReflect.Descriptor instead. func (*SetClusterStatusRequest) Descriptor() ([]byte, []int) { - return file_proto_operator_proto_rawDescGZIP(), []int{10} + return file_proto_operator_proto_rawDescGZIP(), []int{12} } func (x *SetClusterStatusRequest) GetCluster() []byte { @@ -672,7 +765,7 @@ type SetClusterStatusResponse struct { func (x *SetClusterStatusResponse) Reset() { *x = SetClusterStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_operator_proto_msgTypes[11] + mi := &file_proto_operator_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -685,7 +778,7 @@ func (x *SetClusterStatusResponse) String() string { func (*SetClusterStatusResponse) ProtoMessage() {} func (x *SetClusterStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_operator_proto_msgTypes[11] + mi := &file_proto_operator_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -698,7 +791,7 @@ func (x *SetClusterStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetClusterStatusResponse.ProtoReflect.Descriptor instead. func (*SetClusterStatusResponse) Descriptor() ([]byte, []int) { - return file_proto_operator_proto_rawDescGZIP(), []int{11} + return file_proto_operator_proto_rawDescGZIP(), []int{13} } func (x *SetClusterStatusResponse) GetJsonStatus() []byte { @@ -719,7 +812,7 @@ type OperatorCapability_RPC struct { func (x *OperatorCapability_RPC) Reset() { *x = OperatorCapability_RPC{} if protoimpl.UnsafeEnabled { - mi := &file_proto_operator_proto_msgTypes[12] + mi := &file_proto_operator_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -732,7 +825,7 @@ func (x *OperatorCapability_RPC) String() string { func (*OperatorCapability_RPC) ProtoMessage() {} func (x *OperatorCapability_RPC) ProtoReflect() protoreflect.Message { - mi := &file_proto_operator_proto_msgTypes[12] + mi := &file_proto_operator_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -745,7 +838,7 @@ func (x *OperatorCapability_RPC) ProtoReflect() protoreflect.Message { // Deprecated: Use OperatorCapability_RPC.ProtoReflect.Descriptor instead. func (*OperatorCapability_RPC) Descriptor() ([]byte, []int) { - return file_proto_operator_proto_rawDescGZIP(), []int{9, 0} + return file_proto_operator_proto_rawDescGZIP(), []int{11, 0} } func (x *OperatorCapability_RPC) GetType() OperatorCapability_RPC_Type { @@ -799,37 +892,43 @@ var file_proto_operator_proto_rawDesc = []byte{ 0x75, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x3c, 0x0a, 0x1b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4d, - 0x75, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x63, - 0x68, 0x22, 0x6a, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, - 0x61, 0x74, 0x68, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xc0, 0x02, - 0x0a, 0x12, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x03, 0x72, 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, - 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, 0x48, 0x00, 0x52, 0x03, - 0x72, 0x70, 0x63, 0x1a, 0xe2, 0x01, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x42, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x63, 0x6e, 0x70, 0x67, - 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x2e, 0x52, 0x50, 0x43, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, - 0x96, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x20, - 0x0a, 0x1c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, - 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, - 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, - 0x45, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, - 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x54, 0x41, 0x54, - 0x45, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x05, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x69, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x11, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, + 0x0a, 0x1b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x65, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x22, 0x6a, 0x0a, 0x0f, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, + 0x27, 0x0a, 0x0f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x74, 0x68, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xd5, 0x02, 0x0a, 0x12, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, + 0x3d, 0x0a, 0x03, 0x72, 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, + 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, 0x48, 0x00, 0x52, 0x03, 0x72, 0x70, 0x63, 0x1a, 0xf7, + 0x01, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x42, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, + 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4c, 0x55, + 0x53, 0x54, 0x45, 0x52, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x02, 0x12, 0x17, 0x0a, + 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4c, 0x55, + 0x53, 0x54, 0x45, 0x52, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, + 0x45, 0x54, 0x5f, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x52, 0x45, + 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, 0x10, 0x06, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x33, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6c, @@ -837,7 +936,7 @@ var file_proto_operator_proto_rawDesc = []byte{ 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x32, 0xfb, 0x04, 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x75, 0x73, 0x32, 0xd8, 0x05, 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x72, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, @@ -877,10 +976,16 @@ var file_proto_operator_proto_rawDesc = []byte{ 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2d, 0x70, 0x67, 0x2f, 0x63, 0x6e, - 0x70, 0x67, 0x2d, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x5b, 0x0a, 0x0a, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x24, + 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2f, 0x5a, + 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2d, 0x70, 0x67, 0x2f, 0x63, 0x6e, 0x70, 0x67, 0x2d, + 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -896,7 +1001,7 @@ func file_proto_operator_proto_rawDescGZIP() []byte { } var file_proto_operator_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_operator_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_proto_operator_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_proto_operator_proto_goTypes = []interface{}{ (OperatorCapability_RPC_Type)(0), // 0: cnpgi.operator.v1.OperatorCapability.RPC.Type (*OperatorCapabilitiesRequest)(nil), // 1: cnpgi.operator.v1.OperatorCapabilitiesRequest @@ -906,31 +1011,35 @@ var file_proto_operator_proto_goTypes = []interface{}{ (*OperatorValidateClusterChangeRequest)(nil), // 5: cnpgi.operator.v1.OperatorValidateClusterChangeRequest (*OperatorValidateClusterChangeResult)(nil), // 6: cnpgi.operator.v1.OperatorValidateClusterChangeResult (*OperatorMutateClusterRequest)(nil), // 7: cnpgi.operator.v1.OperatorMutateClusterRequest - (*OperatorMutateClusterResult)(nil), // 8: cnpgi.operator.v1.OperatorMutateClusterResult - (*ValidationError)(nil), // 9: cnpgi.operator.v1.ValidationError - (*OperatorCapability)(nil), // 10: cnpgi.operator.v1.OperatorCapability - (*SetClusterStatusRequest)(nil), // 11: cnpgi.operator.v1.SetClusterStatusRequest - (*SetClusterStatusResponse)(nil), // 12: cnpgi.operator.v1.SetClusterStatusResponse - (*OperatorCapability_RPC)(nil), // 13: cnpgi.operator.v1.OperatorCapability.RPC + (*DeregisterRequest)(nil), // 8: cnpgi.operator.v1.DeregisterRequest + (*DeregisterResponse)(nil), // 9: cnpgi.operator.v1.DeregisterResponse + (*OperatorMutateClusterResult)(nil), // 10: cnpgi.operator.v1.OperatorMutateClusterResult + (*ValidationError)(nil), // 11: cnpgi.operator.v1.ValidationError + (*OperatorCapability)(nil), // 12: cnpgi.operator.v1.OperatorCapability + (*SetClusterStatusRequest)(nil), // 13: cnpgi.operator.v1.SetClusterStatusRequest + (*SetClusterStatusResponse)(nil), // 14: cnpgi.operator.v1.SetClusterStatusResponse + (*OperatorCapability_RPC)(nil), // 15: cnpgi.operator.v1.OperatorCapability.RPC } var file_proto_operator_proto_depIdxs = []int32{ - 10, // 0: cnpgi.operator.v1.OperatorCapabilitiesResult.capabilities:type_name -> cnpgi.operator.v1.OperatorCapability - 9, // 1: cnpgi.operator.v1.OperatorValidateClusterCreateResult.validation_errors:type_name -> cnpgi.operator.v1.ValidationError - 9, // 2: cnpgi.operator.v1.OperatorValidateClusterChangeResult.validation_errors:type_name -> cnpgi.operator.v1.ValidationError - 13, // 3: cnpgi.operator.v1.OperatorCapability.rpc:type_name -> cnpgi.operator.v1.OperatorCapability.RPC + 12, // 0: cnpgi.operator.v1.OperatorCapabilitiesResult.capabilities:type_name -> cnpgi.operator.v1.OperatorCapability + 11, // 1: cnpgi.operator.v1.OperatorValidateClusterCreateResult.validation_errors:type_name -> cnpgi.operator.v1.ValidationError + 11, // 2: cnpgi.operator.v1.OperatorValidateClusterChangeResult.validation_errors:type_name -> cnpgi.operator.v1.ValidationError + 15, // 3: cnpgi.operator.v1.OperatorCapability.rpc:type_name -> cnpgi.operator.v1.OperatorCapability.RPC 0, // 4: cnpgi.operator.v1.OperatorCapability.RPC.type:type_name -> cnpgi.operator.v1.OperatorCapability.RPC.Type 1, // 5: cnpgi.operator.v1.Operator.GetCapabilities:input_type -> cnpgi.operator.v1.OperatorCapabilitiesRequest 3, // 6: cnpgi.operator.v1.Operator.ValidateClusterCreate:input_type -> cnpgi.operator.v1.OperatorValidateClusterCreateRequest 5, // 7: cnpgi.operator.v1.Operator.ValidateClusterChange:input_type -> cnpgi.operator.v1.OperatorValidateClusterChangeRequest 7, // 8: cnpgi.operator.v1.Operator.MutateCluster:input_type -> cnpgi.operator.v1.OperatorMutateClusterRequest - 11, // 9: cnpgi.operator.v1.Operator.SetClusterStatus:input_type -> cnpgi.operator.v1.SetClusterStatusRequest - 2, // 10: cnpgi.operator.v1.Operator.GetCapabilities:output_type -> cnpgi.operator.v1.OperatorCapabilitiesResult - 4, // 11: cnpgi.operator.v1.Operator.ValidateClusterCreate:output_type -> cnpgi.operator.v1.OperatorValidateClusterCreateResult - 6, // 12: cnpgi.operator.v1.Operator.ValidateClusterChange:output_type -> cnpgi.operator.v1.OperatorValidateClusterChangeResult - 8, // 13: cnpgi.operator.v1.Operator.MutateCluster:output_type -> cnpgi.operator.v1.OperatorMutateClusterResult - 12, // 14: cnpgi.operator.v1.Operator.SetClusterStatus:output_type -> cnpgi.operator.v1.SetClusterStatusResponse - 10, // [10:15] is the sub-list for method output_type - 5, // [5:10] is the sub-list for method input_type + 13, // 9: cnpgi.operator.v1.Operator.SetClusterStatus:input_type -> cnpgi.operator.v1.SetClusterStatusRequest + 8, // 10: cnpgi.operator.v1.Operator.Deregister:input_type -> cnpgi.operator.v1.DeregisterRequest + 2, // 11: cnpgi.operator.v1.Operator.GetCapabilities:output_type -> cnpgi.operator.v1.OperatorCapabilitiesResult + 4, // 12: cnpgi.operator.v1.Operator.ValidateClusterCreate:output_type -> cnpgi.operator.v1.OperatorValidateClusterCreateResult + 6, // 13: cnpgi.operator.v1.Operator.ValidateClusterChange:output_type -> cnpgi.operator.v1.OperatorValidateClusterChangeResult + 10, // 14: cnpgi.operator.v1.Operator.MutateCluster:output_type -> cnpgi.operator.v1.OperatorMutateClusterResult + 14, // 15: cnpgi.operator.v1.Operator.SetClusterStatus:output_type -> cnpgi.operator.v1.SetClusterStatusResponse + 9, // 16: cnpgi.operator.v1.Operator.Deregister:output_type -> cnpgi.operator.v1.DeregisterResponse + 11, // [11:17] is the sub-list for method output_type + 5, // [5:11] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name 5, // [5:5] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name @@ -1027,7 +1136,7 @@ func file_proto_operator_proto_init() { } } file_proto_operator_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OperatorMutateClusterResult); i { + switch v := v.(*DeregisterRequest); i { case 0: return &v.state case 1: @@ -1039,7 +1148,7 @@ func file_proto_operator_proto_init() { } } file_proto_operator_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidationError); i { + switch v := v.(*DeregisterResponse); i { case 0: return &v.state case 1: @@ -1051,7 +1160,7 @@ func file_proto_operator_proto_init() { } } file_proto_operator_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OperatorCapability); i { + switch v := v.(*OperatorMutateClusterResult); i { case 0: return &v.state case 1: @@ -1063,7 +1172,7 @@ func file_proto_operator_proto_init() { } } file_proto_operator_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetClusterStatusRequest); i { + switch v := v.(*ValidationError); i { case 0: return &v.state case 1: @@ -1075,7 +1184,7 @@ func file_proto_operator_proto_init() { } } file_proto_operator_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetClusterStatusResponse); i { + switch v := v.(*OperatorCapability); i { case 0: return &v.state case 1: @@ -1087,6 +1196,30 @@ func file_proto_operator_proto_init() { } } file_proto_operator_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetClusterStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_operator_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetClusterStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_operator_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OperatorCapability_RPC); i { case 0: return &v.state @@ -1099,7 +1232,7 @@ func file_proto_operator_proto_init() { } } } - file_proto_operator_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_proto_operator_proto_msgTypes[11].OneofWrappers = []interface{}{ (*OperatorCapability_Rpc)(nil), } type x struct{} @@ -1108,7 +1241,7 @@ func file_proto_operator_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_operator_proto_rawDesc, NumEnums: 1, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/operator/operator_grpc.pb.go b/pkg/operator/operator_grpc.pb.go index 52e401a..e0d11f9 100644 --- a/pkg/operator/operator_grpc.pb.go +++ b/pkg/operator/operator_grpc.pb.go @@ -24,6 +24,7 @@ const ( Operator_ValidateClusterChange_FullMethodName = "/cnpgi.operator.v1.Operator/ValidateClusterChange" Operator_MutateCluster_FullMethodName = "/cnpgi.operator.v1.Operator/MutateCluster" Operator_SetClusterStatus_FullMethodName = "/cnpgi.operator.v1.Operator/SetClusterStatus" + Operator_Deregister_FullMethodName = "/cnpgi.operator.v1.Operator/Deregister" ) // OperatorClient is the client API for Operator service. @@ -43,6 +44,9 @@ type OperatorClient interface { // SetClusterStatus is invoked at the end of the reconciliation loop and it is used to set the plugin status // inside the .status.plugins[pluginName] map key SetClusterStatus(ctx context.Context, in *SetClusterStatusRequest, opts ...grpc.CallOption) (*SetClusterStatusResponse, error) + // Deregister is invoked when the plugin is removed from the cluster definition. It is expected that the plugin + // executes its cleanup logic when this method is invoked. + Deregister(ctx context.Context, in *DeregisterRequest, opts ...grpc.CallOption) (*DeregisterResponse, error) } type operatorClient struct { @@ -98,6 +102,15 @@ func (c *operatorClient) SetClusterStatus(ctx context.Context, in *SetClusterSta return out, nil } +func (c *operatorClient) Deregister(ctx context.Context, in *DeregisterRequest, opts ...grpc.CallOption) (*DeregisterResponse, error) { + out := new(DeregisterResponse) + err := c.cc.Invoke(ctx, Operator_Deregister_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // OperatorServer is the server API for Operator service. // All implementations must embed UnimplementedOperatorServer // for forward compatibility @@ -115,6 +128,9 @@ type OperatorServer interface { // SetClusterStatus is invoked at the end of the reconciliation loop and it is used to set the plugin status // inside the .status.plugins[pluginName] map key SetClusterStatus(context.Context, *SetClusterStatusRequest) (*SetClusterStatusResponse, error) + // Deregister is invoked when the plugin is removed from the cluster definition. It is expected that the plugin + // executes its cleanup logic when this method is invoked. + Deregister(context.Context, *DeregisterRequest) (*DeregisterResponse, error) mustEmbedUnimplementedOperatorServer() } @@ -137,6 +153,9 @@ func (UnimplementedOperatorServer) MutateCluster(context.Context, *OperatorMutat func (UnimplementedOperatorServer) SetClusterStatus(context.Context, *SetClusterStatusRequest) (*SetClusterStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetClusterStatus not implemented") } +func (UnimplementedOperatorServer) Deregister(context.Context, *DeregisterRequest) (*DeregisterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deregister not implemented") +} func (UnimplementedOperatorServer) mustEmbedUnimplementedOperatorServer() {} // UnsafeOperatorServer may be embedded to opt out of forward compatibility for this service. @@ -240,6 +259,24 @@ func _Operator_SetClusterStatus_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Operator_Deregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeregisterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperatorServer).Deregister(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Operator_Deregister_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperatorServer).Deregister(ctx, req.(*DeregisterRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Operator_ServiceDesc is the grpc.ServiceDesc for Operator service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -267,6 +304,10 @@ var Operator_ServiceDesc = grpc.ServiceDesc{ MethodName: "SetClusterStatus", Handler: _Operator_SetClusterStatus_Handler, }, + { + MethodName: "Deregister", + Handler: _Operator_Deregister_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/operator.proto", diff --git a/proto/operator.proto b/proto/operator.proto index 3523448..44eed2f 100644 --- a/proto/operator.proto +++ b/proto/operator.proto @@ -20,6 +20,10 @@ service Operator { // SetClusterStatus is invoked at the end of the reconciliation loop and it is used to set the plugin status // inside the .status.plugins[pluginName] map key rpc SetClusterStatus(SetClusterStatusRequest) returns (SetClusterStatusResponse) {} + + // Deregister is invoked when the plugin is removed from the cluster definition. It is expected that the plugin + // executes its cleanup logic when this method is invoked. + rpc Deregister(DeregisterRequest) returns (DeregisterResponse) {} } message OperatorCapabilitiesRequest { @@ -67,6 +71,16 @@ message OperatorMutateClusterRequest { bytes definition = 1; } +message DeregisterRequest { + // This field is REQUIRED. Value of this field is the JSON + // serialization of the Cluster that should receive the + // default values + bytes definition = 1; +} + +message DeregisterResponse { +} + message OperatorMutateClusterResult { // This field is OPTIONAL. Value of this field is a JSONPatch // to be applied on the passed Cluster definition @@ -106,6 +120,10 @@ message OperatorCapability { // TYPE_SET_CLUSTER_STATUS indicates that the Plugin is able to // set cluster status TYPE_SET_CLUSTER_STATUS = 5; + + // TYPE_DEREGISTER indicates that the Plugin is able to execute the cleanup logic once it is removed from + // the cluster definition + TYPE_DEREGISTER = 6; } Type type = 1; diff --git a/proto/operator_lifecycle.proto b/proto/operator_lifecycle.proto index f7d9146..c93a070 100644 --- a/proto/operator_lifecycle.proto +++ b/proto/operator_lifecycle.proto @@ -40,6 +40,7 @@ message OperatorOperationType { TYPE_UPDATE = 2; TYPE_CREATE = 3; TYPE_DELETE = 4; + TYPE_DEREGISTER = 5; } Type type = 1;