Fix ansible delegate mode only working with ssh (#6858)

This commit is contained in:
wendrul
2025-10-17 13:58:00 +00:00
committed by GitHub
parent 08e1807dfe
commit 189fb507da
2 changed files with 13 additions and 3 deletions
+12 -2
View File
@@ -1432,7 +1432,7 @@ async fn get_git_commit_hash(
false,
)
.await
.map_err(|e| Error::NotAuthorized(format!("Access to resource {} denied: ({e})", path)))?;
.map_err(|e| Error::NotFound(format!("Access to resource {} denied: ({e})", path)))?;
let git_resource: GitRepositoryResource = match git_repo_resource_value {
Some(value) => serde_json::from_value(value).map_err(|e| {
@@ -1443,7 +1443,17 @@ async fn get_git_commit_hash(
let identities: Vec<String> = query
.git_ssh_identity
.map(|s| s.split(",").map(|s| s.to_string()).collect())
.map(|s| {
s.split(",")
.filter_map(|s| {
if !s.is_empty() {
Some(s.to_string())
} else {
None
}
})
.collect()
})
.unwrap_or(vec![]);
let (git_ssh_cmd, filenames) =
@@ -106,7 +106,7 @@
isCheckingPathExists = false
}
} catch (err: any) {
error = `Failed to load git repository ${gitRepoResourcePath}: ${err.message || 'Unknown error'}`
error = `Failed to load git repository ${gitRepoResourcePath}: ${err.status} - ${err.message || 'Unknown error'}: ${err.body}`
isLoadingCommitHash = false
isCheckingPathExists = false
}