Skip to content

Commit

Permalink
fix: use bytes for JSON serialization instead of strings (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Cecchi <[email protected]>
  • Loading branch information
leonardoce authored Jan 18, 2024
1 parent a18f8f5 commit e99be6d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
64 changes: 32 additions & 32 deletions pkg/operator/operator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions proto/operator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ service Operator {
message OperatorMutatePodRequest {
// This field is REQUIRED. Value of this field is the JSON
// serialization of the Cluster corresponding to the Pod being applied
string cluster_definition = 1;
bytes cluster_definition = 1;

// This field is REQUIRED. Value of this field is the JSON
// serialization of the Pod that is being applied
string pod_definition = 2;
bytes pod_definition = 2;
}

message OperatorMutatePodResult {
// This field is OPTIONAL. Value of this field is the JSON
// serialization of the Pod as modified by the plugin.
// If not present, the operator will assume that no changes
// have been requested by the plugins
string definition = 1;
bytes definition = 1;
}

message OperatorCapabilitiesRequest {
Expand All @@ -53,7 +53,7 @@ message OperatorCapabilitiesResult {
message OperatorValidateClusterCreateRequest {
// This field is REQUIRED. Value of this field is the JSON
// serialization of the Cluster that is being created
string definition = 1;
bytes definition = 1;
}

message OperatorValidateClusterCreateResult {
Expand All @@ -65,11 +65,11 @@ message OperatorValidateClusterCreateResult {
message OperatorValidateClusterChangeRequest {
// This field is REQUIRED. Value of this field is the JSON
// serialization of the current Cluster definition
string old_cluster = 1;
bytes old_cluster = 1;

// This field is REQUIRED. Value of this field is the JSON
// serialization of the updated Cluster definition
string new_cluster = 2;
bytes new_cluster = 2;
}

message OperatorValidateClusterChangeResult {
Expand All @@ -82,14 +82,14 @@ message OperatorMutateClusterRequest {
// This field is REQUIRED. Value of this field is the JSON
// serialization of the Cluster that should receive the
// default values
string definition = 1;
bytes definition = 1;
}

message OperatorMutateClusterResult {
// This field is REQUIRED. Value of this field is the JSON
// serialization of the Cluster that have received the
// default values
string definition = 1;
bytes definition = 1;
}

message ValidationError {
Expand Down

0 comments on commit e99be6d

Please sign in to comment.