Skip to content

Commit c2ea4e6

Browse files
authored
Merge pull request #198 from serokell/rvem/#197-fix-options-handling-with-remote-build
[#197] Fix hostname overriding for remote builds
2 parents 8c9ea96 + 55aac55 commit c2ea4e6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/push.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,12 @@ pub async fn build_profile_remotely(data: &PushProfileData<'_>, derivation_name:
155155
data.deploy_data.profile_name, data.deploy_data.node_name
156156
);
157157

158-
let store_address = format!("ssh-ng://{}@{}",
159-
if data.deploy_data.profile.generic_settings.ssh_user.is_some() {
160-
&data.deploy_data.profile.generic_settings.ssh_user.as_ref().unwrap()
161-
} else {
162-
&data.deploy_defs.ssh_user
163-
},
164-
data.deploy_data.node.node_settings.hostname
165-
);
158+
// TODO: this should probably be handled more nicely during 'data' construction
159+
let hostname = match data.deploy_data.cmd_overrides.hostname {
160+
Some(ref x) => x,
161+
None => &data.deploy_data.node.node_settings.hostname,
162+
};
163+
let store_address = format!("ssh-ng://{}@{}", data.deploy_defs.ssh_user, hostname);
166164

167165
let ssh_opts_str = data.deploy_data.merged_settings.ssh_opts.join(" ");
168166

0 commit comments

Comments
 (0)