Skip to content

Commit

Permalink
Removed 'Result'
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Nov 25, 2024
1 parent 705998e commit 81fd35f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/+type-fix.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed return type of a function in mirrord-operator client code.
8 changes: 3 additions & 5 deletions mirrord/kube/src/resolved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,15 @@ impl ResolvedTarget<true> {
api_version: &str,
plural: &str,
url_path: &str,
) -> Result<String, KubeApiError> {
) -> String {
let name = self.urlfied_name();
let namespace = self.namespace().unwrap_or("default");

let url = if use_proxy {
if use_proxy {
format!("/apis/{api_version}/proxy/namespaces/{namespace}/{plural}/{name}?on_concurrent_steal={concurrent_steal}&connect=true")
} else {
format!("{url_path}/{name}?on_concurrent_steal={concurrent_steal}&connect=true")
};

Ok(url)
}
}

pub fn urlfied_name(&self) -> String {
Expand Down
2 changes: 1 addition & 1 deletion mirrord/operator/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ impl OperatorApi<PreparedClientCert> {
&TargetCrd::api_version(&()),
&TargetCrd::plural(&()),
&TargetCrd::url_path(&(), target.namespace()),
)?
)
};

tracing::debug!("connect_url {connect_url:?}");
Expand Down

0 comments on commit 81fd35f

Please sign in to comment.