Skip to content

Commit b8edd1f

Browse files
authored
Merge pull request #276 from hashicorp/oslogin-fix
FIX: Fixed a bug in OSLogin flow
2 parents 80ec131 + 4075490 commit b8edd1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builder/googlecompute/step_import_os_login_ssh_key.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ func (s *StepImportOSLoginSSHKey) Run(ctx context.Context, state multistep.State
4545
log.Printf("failed to get project metadata: %s", err)
4646
}
4747

48-
if config.UseOSLogin.False() || (config.UseOSLogin.ToBoolPointer() == nil && strings.EqualFold(osLoginEnabledAtProject, "false")) {
48+
if config.UseOSLogin.False() || (config.UseOSLogin.ToBoolPointer() == nil && (err != nil || strings.EqualFold(osLoginEnabledAtProject, "false"))) {
49+
config.loginProfileUsername = config.Comm.SSHUsername
4950
return multistep.ActionContinue
5051
}
5152

0 commit comments

Comments
 (0)