Skip to content

Commit 4087d13

Browse files
committed
Setup is responsible for determining hardlink support, not the depot.
1 parent 03f30b1 commit 4087d13

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

pkg/runtime/depot.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ func (e ErrVolumeMismatch) Error() string {
5151
}
5252

5353
type depot struct {
54-
config depotConfig
55-
depotPath string
56-
artifacts map[strfmt.UUID]struct{}
57-
fsMutex *sync.Mutex
58-
SupportsHardLinks bool
54+
config depotConfig
55+
depotPath string
56+
artifacts map[strfmt.UUID]struct{}
57+
fsMutex *sync.Mutex
5958
}
6059

6160
func newDepot(runtimePath string) (*depot, error) {
@@ -75,10 +74,9 @@ func newDepot(runtimePath string) (*depot, error) {
7574
config: depotConfig{
7675
Deployments: map[strfmt.UUID][]deployment{},
7776
},
78-
depotPath: depotPath,
79-
artifacts: map[strfmt.UUID]struct{}{},
80-
fsMutex: &sync.Mutex{},
81-
SupportsHardLinks: supportsHardLinks(depotPath),
77+
depotPath: depotPath,
78+
artifacts: map[strfmt.UUID]struct{}{},
79+
fsMutex: &sync.Mutex{},
8280
}
8381

8482
if !fileutils.TargetExists(depotPath) {
@@ -148,10 +146,6 @@ func (d *depot) Put(id strfmt.UUID) error {
148146

149147
// DeployViaLink will take an artifact from the depot and link it to the target path.
150148
func (d *depot) DeployViaLink(id strfmt.UUID, relativeSrc, absoluteDest string) error {
151-
if !d.SupportsHardLinks {
152-
return errs.New("depot does not support hard links; use copy instead")
153-
}
154-
155149
d.fsMutex.Lock()
156150
defer d.fsMutex.Unlock()
157151

pkg/runtime/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ func (s *setup) install(id strfmt.UUID) (rerr error) {
470470
if err := envDef.ApplyFileTransforms(s.path); err != nil {
471471
return errs.Wrap(err, "Could not apply env transforms")
472472
}
473-
} else if s.depot.SupportsHardLinks {
473+
} else if supportsHardLinks(s.depot.depotPath) {
474474
if err := s.depot.DeployViaLink(id, envDef.InstallDir, s.path); err != nil {
475475
return errs.Wrap(err, "Could not deploy artifact via link")
476476
}

0 commit comments

Comments
 (0)