@@ -15,8 +15,8 @@ pub struct DumpConfig {
1515 etcd_uri : Option < String > ,
1616 /// Period states to collect logs from specified duration
1717 since : humantime:: Duration ,
18- /// Path to kubeconfig file, which requires to interact with Kube-Apiserver
19- kube_config_path : Option < std :: path :: PathBuf > ,
18+ /// The kubeconfig options
19+ kubeconfig : crate :: KubeConfigArgs ,
2020 /// Specifies the timeout value to interact with other systems
2121 timeout : humantime:: Duration ,
2222 /// Specfies the output format, i.e tar, stdout.
@@ -37,7 +37,7 @@ impl DumpConfig {
3737 /// * `loki_uri` - Optional address of the Loki service endpoint.
3838 /// * `etcd_uri` - Optional address of the etcd service endpoint.
3939 /// * `since` - Duration from which to collect logs.
40- /// * `kube_config_path ` - Optional path to the kubeconfig file.
40+ /// * `kubeconfig ` - kubeconfig file and options .
4141 /// * `timeout` - Timeout duration for interacting with external systems.
4242 /// * `output_format` - Output format (e.g., tar, stdout).
4343 /// * `tenant_id` - Tenant ID used while querying.
@@ -49,7 +49,7 @@ impl DumpConfig {
4949 loki_uri : Option < String > ,
5050 etcd_uri : Option < String > ,
5151 since : humantime:: Duration ,
52- kube_config_path : Option < std :: path :: PathBuf > ,
52+ kubeconfig : crate :: KubeConfigArgs ,
5353 timeout : humantime:: Duration ,
5454 output_format : OutputFormat ,
5555 tenant_id : String ,
@@ -61,7 +61,7 @@ impl DumpConfig {
6161 loki_uri,
6262 etcd_uri,
6363 since,
64- kube_config_path ,
64+ kubeconfig ,
6565 timeout,
6666 output_format,
6767 tenant_id,
@@ -94,9 +94,19 @@ impl DumpConfig {
9494 & self . since
9595 }
9696
97+ /// Returns a reference to the [`crate::KubeConfigArgs`].
98+ pub fn kubeconfig ( & self ) -> & crate :: KubeConfigArgs {
99+ & self . kubeconfig
100+ }
101+
97102 /// Returns the optional path to the kubeconfig file used to interact with the Kube-Apiserver.
98103 pub fn kube_config_path ( & self ) -> Option < & std:: path:: PathBuf > {
99- self . kube_config_path . as_ref ( )
104+ self . kubeconfig . path . as_ref ( )
105+ }
106+
107+ /// Returns the optional context to the kubeconfig file used to interact with the Kube-Apiserver.
108+ pub fn kube_config_opts ( & self ) -> & kube:: config:: KubeConfigOptions {
109+ & self . kubeconfig . opts
100110 }
101111
102112 /// Returns the timeout duration used to interact with external systems.
0 commit comments