Skip to content

Commit

Permalink
api: k8s probe validate rules (#2702)
Browse files Browse the repository at this point in the history
  • Loading branch information
fran2344 authored Jun 22, 2023
1 parent 9140e9b commit 0084ab4
Show file tree
Hide file tree
Showing 5 changed files with 1,565 additions and 1,594 deletions.
16 changes: 8 additions & 8 deletions api/k8s/v1/k8s.proto
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,10 @@ message ExecAction {
}

message HTTPGetAction {
optional string path = 1;
optional int32 port = 2;
optional string host = 3;
optional string scheme = 4;
string path = 1 [ (validate.rules).string.pattern = "^/.*$" ];
int32 port = 2 [ (validate.rules).int32 = {gte : 0, lte : 65535} ];
string host = 3 [ (validate.rules).string.hostname = true ];
string scheme = 4 [ (validate.rules).string.pattern = "^(http|https)$" ];
repeated HTTPHeader http_headers = 5;
}

Expand All @@ -618,13 +618,13 @@ message HTTPHeader {
}

message TCPSocketAction {
optional int32 port = 1;
optional string host = 2;
int32 port = 1 [ (validate.rules).int32 = {gte : 0, lte : 65535} ];
string host = 2 [ (validate.rules).string.hostname = true ];
}

message GRPCAction {
optional int32 port = 1;
optional string service = 2;
int32 port = 1 [ (validate.rules).int32 = {gte : 0, lte : 65535} ];
string service = 2 [ (validate.rules).string.pattern = "^$|^[a-zA-Z0-9.-]+$" ];
}

message Probe {
Expand Down
Loading

0 comments on commit 0084ab4

Please sign in to comment.