Skip to content

Commit

Permalink
Try to truncate import path
Browse files Browse the repository at this point in the history
  • Loading branch information
xlucas committed Jan 27, 2025
1 parent fec6930 commit 4a35b88
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 34 deletions.
4 changes: 4 additions & 0 deletions proto/autoscaling/kubernetes/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ proto_library(
"recommender.proto",
],
visibility = ["//visibility:public"],
deps = [
"@com_google_protobuf//:timestamp_proto",
"@com_github_chrusty_protoc_gen_jsonschema//:go_default_liobrary",
],
)
97 changes: 65 additions & 32 deletions proto/autoscaling/kubernetes/autoscaling.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,113 @@ option go_package = "github.com/DataDog/agent-payload/v5/autoscaling/kubernetes"

package datadog.autoscaling.kubernetes;

import "github.com/DataDog/agent-payload/v5/proto/autoscaling/kubernetes/common.proto";
import "proto/autoscaling/kubernetes/common.proto";

import "google/protobuf/timestamp.proto";
import "github.com/chrusty/protoc-gen-jsonschema/options.proto";

// WorkloadValuesList represents a list of workload values
message WorkloadValuesList {
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;

repeated WorkloadValues values = 1;
repeated WorkloadValues values = 1;
}

// WorkloadValues represents the values of a workload
message WorkloadValues {
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options).ignore = true;

string namespace = 1 [(protoc.gen.jsonschema.field_options).required = true]; // Namespace is the namespace of PodAutoscaler object
string name = 2 [(protoc.gen.jsonschema.field_options).required = true]; // Name is the name of the PodAutoscaler object
string namespace = 1
[(protoc.gen.jsonschema.field_options).required =
true]; // Namespace is the namespace of PodAutoscaler object
string name = 2 [(protoc.gen.jsonschema.field_options).required =
true]; // Name is the name of the PodAutoscaler object

Error error = 3; // Error is any global error that prevent the calculation of new values (not specific to horizontal or vertical values)
Error error =
3; // Error is any global error that prevent the calculation of new
// values (not specific to horizontal or vertical values)

WorkloadHorizontalValues horizontal = 4;
WorkloadVerticalValues vertical = 5;
WorkloadVerticalValues vertical = 5;
}

message WorkloadHorizontalValues {
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options).ignore = true;

Error error = 1; // Error is the error message if new values cannot be calculated

WorkloadHorizontalData manual = 2; // Manual is the manual override values for the workload
WorkloadHorizontalData auto = 3; // Auto is the periodic recommendation values for the workload
Error error =
1; // Error is the error message if new values cannot be calculated

WorkloadHorizontalData manual =
2; // Manual is the manual override values for the workload
WorkloadHorizontalData auto =
3; // Auto is the periodic recommendation values for the workload
}

message WorkloadHorizontalData {
option (protoc.gen.jsonschema.message_options).ignore = true;
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;

google.protobuf.Timestamp timestamp = 1 [(protoc.gen.jsonschema.field_options).required = true]; // Timestamp is the time the values were generated
optional int32 replicas = 2 [(protoc.gen.jsonschema.field_options).required = true]; // Replicas is the number of replicas the workload should have
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;

google.protobuf.Timestamp timestamp = 1
[(protoc.gen.jsonschema.field_options).required =
true]; // Timestamp is the time the values were generated
optional int32 replicas = 2 [
(protoc.gen.jsonschema.field_options).required = true
]; // Replicas is the number of replicas the workload should have
}

message WorkloadVerticalValues {
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options).ignore = true;

Error error = 1; // Error is the error message if new values cannot be calculated
Error error =
1; // Error is the error message if new values cannot be calculated

WorkloadVerticalData manual = 2; // Manual is the manual override values for the workload
WorkloadVerticalData auto = 3; // Auto is the periodic recommendation values for the workload
WorkloadVerticalData manual =
2; // Manual is the manual override values for the workload
WorkloadVerticalData auto =
3; // Auto is the periodic recommendation values for the workload
}

message WorkloadVerticalData {
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options).ignore = true;

google.protobuf.Timestamp timestamp = 1 [(protoc.gen.jsonschema.field_options).required = true]; // Timestamp is the time the values were generated
repeated ContainerResources resources = 2 [(protoc.gen.jsonschema.field_options).required = true]; // Resources is the list of resources for the workload
google.protobuf.Timestamp timestamp = 1
[(protoc.gen.jsonschema.field_options).required =
true]; // Timestamp is the time the values were generated
repeated ContainerResources resources = 2
[(protoc.gen.jsonschema.field_options).required =
true]; // Resources is the list of resources for the workload
}

message ContainerResources {
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;
option (protoc.gen.jsonschema.message_options).ignore = true;

message ResourceList {
option (protoc.gen.jsonschema.message_options).disallow_additional_properties = true;

string name = 1 [(protoc.gen.jsonschema.field_options).required = true]; // Name is the name of the resource (e.g. "cpu" or "memory")
string value = 2 [(protoc.gen.jsonschema.field_options).required = true]; // Value is stored in Kubernetes format (e.g. "1Gi")
option (protoc.gen.jsonschema.message_options)
.disallow_additional_properties = true;

string name = 1 [
(protoc.gen.jsonschema.field_options).required = true
]; // Name is the name of the resource (e.g. "cpu" or "memory")
string value = 2
[(protoc.gen.jsonschema.field_options).required =
true]; // Value is stored in Kubernetes format (e.g. "1Gi")
}

string containerName = 1 [(protoc.gen.jsonschema.field_options).required = true]; // ContainerName is the name of the container
repeated ResourceList requests = 2;
repeated ResourceList limits = 3;
string containerName = 1
[(protoc.gen.jsonschema.field_options).required =
true]; // ContainerName is the name of the container
repeated ResourceList requests = 2;
repeated ResourceList limits = 3;
}
4 changes: 2 additions & 2 deletions proto/autoscaling/kubernetes/recommender.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ option go_package = "github.com/DataDog/agent-payload/v5/autoscaling/kubernetes"

package datadog.autoscaling.kubernetes;

import "github.com/DataDog/agent-payload/v5/proto/autoscaling/kubernetes/common.proto";
import "proto/autoscaling/kubernetes/common.proto";

import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
Expand Down Expand Up @@ -72,4 +72,4 @@ message WorkloadRecommendationReply {
optional int32 upperBoundReplicas = 5; // UpperBoundReplicas is the number of replicas based on upperBound input
repeated WorkloadRecommendationTarget observedTargets = 6; // ObservedTargets is the list of observed targets (only the targetValue will be set)
string reason = 7; // Reason explains recommender decision
}
}

0 comments on commit 4a35b88

Please sign in to comment.