Skip to content

Commit 71e9128

Browse files
committed
Apply PR feedback suggestions.
1 parent 2a2d4d7 commit 71e9128

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

pkg/runtime/links_windows.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ const linkTarget = "__target__"
1414
const link = "__link__"
1515

1616
func supportsHardLinks(path string) (supported bool) {
17-
logging.Debug("Determining if hard links are supported for drive associated with '%s'", path)
1817
defer func() {
19-
log := "Yes they are"
2018
if !supported {
21-
log = "No they are not"
19+
logging.Debug("Enforcing deployment via copy, as hardlinks are not supported")
2220
}
23-
logging.Debug(log)
2421
}()
2522

2623
target := filepath.Join(path, linkTarget)

pkg/runtime/setup.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,21 +465,19 @@ func (s *setup) install(id strfmt.UUID) (rerr error) {
465465
return errs.Wrap(err, "Could not get env")
466466
}
467467

468-
if envDef.NeedsTransforms() {
468+
if envDef.NeedsTransforms() || !s.supportsHardLinks {
469469
if err := s.depot.DeployViaCopy(id, envDef.InstallDir, s.path); err != nil {
470470
return errs.Wrap(err, "Could not deploy artifact via copy")
471471
}
472-
if err := envDef.ApplyFileTransforms(s.path); err != nil {
473-
return errs.Wrap(err, "Could not apply env transforms")
472+
if s.supportsHardLinks {
473+
if err := envDef.ApplyFileTransforms(s.path); err != nil {
474+
return errs.Wrap(err, "Could not apply env transforms")
475+
}
474476
}
475-
} else if s.supportsHardLinks {
477+
} else {
476478
if err := s.depot.DeployViaLink(id, envDef.InstallDir, s.path); err != nil {
477479
return errs.Wrap(err, "Could not deploy artifact via link")
478480
}
479-
} else {
480-
if err := s.depot.DeployViaCopy(id, envDef.InstallDir, s.path); err != nil {
481-
return errs.Wrap(err, "Could not deploy artifact via copy")
482-
}
483481
}
484482

485483
return nil

0 commit comments

Comments
 (0)