@@ -41,35 +41,39 @@ pub enum ProbeAction {
41
41
TcpSocket ( TCPSocketAction ) ,
42
42
}
43
43
44
- impl < Period > ProbeBuilder < ( ) , Period > {
44
+ impl ProbeBuilder < ( ) , ( ) > {
45
45
/// This probe action executes the specified command
46
46
pub fn with_exec_action_helper (
47
47
self ,
48
48
command : impl IntoIterator < Item = impl Into < String > > ,
49
- ) -> ProbeBuilder < ProbeAction , Period > {
49
+ ) -> ProbeBuilder < ProbeAction , ( ) > {
50
50
self . with_exec_action ( ExecAction {
51
51
command : Some ( command. into_iter ( ) . map ( Into :: into) . collect ( ) ) ,
52
52
} )
53
53
}
54
54
55
55
/// There is a convenience helper: [`Self::with_exec_action_helper`].
56
- pub fn with_exec_action ( self , exec_action : ExecAction ) -> ProbeBuilder < ProbeAction , Period > {
56
+ pub fn with_exec_action ( self , exec_action : ExecAction ) -> ProbeBuilder < ProbeAction , ( ) > {
57
57
self . with_action ( ProbeAction :: Exec ( exec_action) )
58
58
}
59
59
60
- pub fn with_grpc_action ( self , grpc_action : GRPCAction ) -> ProbeBuilder < ProbeAction , Period > {
60
+ pub fn with_grpc_action ( self , grpc_action : GRPCAction ) -> ProbeBuilder < ProbeAction , ( ) > {
61
61
self . with_action ( ProbeAction :: Grpc ( grpc_action) )
62
62
}
63
63
64
+ // Note: Ideally we also have a builder for `HTTPGetAction`, but that is lot's of effort we
65
+ // don't want to spend now.
64
66
/// This probe action does an HTTP GET request to the specified port. Optionally, you can
65
67
/// configure the path, otherwise the Kubernetes default is used.
66
68
pub fn with_http_get_action_helper (
67
69
self ,
68
70
port : u16 ,
71
+ scheme : Option < String > ,
69
72
path : Option < String > ,
70
- ) -> ProbeBuilder < ProbeAction , Period > {
73
+ ) -> ProbeBuilder < ProbeAction , ( ) > {
71
74
self . with_http_get_action ( HTTPGetAction {
72
75
path,
76
+ scheme,
73
77
port : IntOrString :: Int ( port. into ( ) ) ,
74
78
..Default :: default ( )
75
79
} )
@@ -79,20 +83,20 @@ impl<Period> ProbeBuilder<(), Period> {
79
83
pub fn with_http_get_action (
80
84
self ,
81
85
http_get_action : HTTPGetAction ,
82
- ) -> ProbeBuilder < ProbeAction , Period > {
86
+ ) -> ProbeBuilder < ProbeAction , ( ) > {
83
87
self . with_action ( ProbeAction :: HttpGet ( http_get_action) )
84
88
}
85
89
86
90
pub fn with_tcp_socket_action (
87
91
self ,
88
92
tcp_socket_action : TCPSocketAction ,
89
- ) -> ProbeBuilder < ProbeAction , Period > {
93
+ ) -> ProbeBuilder < ProbeAction , ( ) > {
90
94
self . with_action ( ProbeAction :: TcpSocket ( tcp_socket_action) )
91
95
}
92
96
93
97
/// Action-specific functions (e.g. [`Self::with_exec_action`] or [`Self::with_http_get_action`])
94
98
/// are recommended instead.
95
- pub fn with_action ( self , action : ProbeAction ) -> ProbeBuilder < ProbeAction , Period > {
99
+ pub fn with_action ( self , action : ProbeAction ) -> ProbeBuilder < ProbeAction , ( ) > {
96
100
let Self {
97
101
action : ( ) ,
98
102
period,
@@ -244,7 +248,7 @@ mod tests {
244
248
#[ test]
245
249
fn test_probe_builder_minimal ( ) {
246
250
let probe = ProbeBuilder :: default ( )
247
- . with_http_get_action_helper ( 8080 , None )
251
+ . with_http_get_action_helper ( 8080 , None , None )
248
252
. with_period ( Duration :: from_secs ( 10 ) )
249
253
. build ( ) ;
250
254
0 commit comments