Skip to content

Commit

Permalink
chore(bors): merge pull request #437
Browse files Browse the repository at this point in the history
437: fix(kubectl/dump/etcd): use correct namespace r=tiagolobocastro a=tiagolobocastro

<!

Co-authored-by: Tiago Castro <[email protected]>
  • Loading branch information
mayastor-bors and tiagolobocastro committed Mar 18, 2024
2 parents ee21d5d + fdef22a commit c63fe2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions k8s/supportability/src/collect/k8s_resources/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ impl ClientSet {
pub(crate) fn kube_client(&self) -> kube::Client {
self.client.clone()
}
/// Get a reference to the namespace.
pub(crate) fn namespace(&self) -> &str {
&self.namespace
}

/// Get a new api for a `dynamic_object` for the provided GVK.
pub(crate) async fn dynamic_object_api(
Expand Down
7 changes: 4 additions & 3 deletions k8s/supportability/src/collect/persistent_store/etcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ impl EtcdStore {
namespace: String,
) -> Result<Self, EtcdError> {
let client_set = ClientSet::new(kube_config_path.clone(), namespace.clone()).await?;
let platform_info = platform::k8s::K8s::from(client_set.kube_client())
.await
.map_err(|e| EtcdError::Custom(format!("Failed to get k8s platform info: {e}")))?;
let platform_info =
platform::k8s::K8s::from_custom(client_set.kube_client(), client_set.namespace())
.await
.map_err(|e| EtcdError::Custom(format!("Failed to get k8s platform info: {e}")))?;
let key_prefix = pstor::build_key_prefix(&platform_info, API_VERSION);

// if an endpoint is provided it will be used, else the kubeconfig path will be used
Expand Down

0 comments on commit c63fe2c

Please sign in to comment.