File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,10 @@ func (e ErrVolumeMismatch) Error() string {
5151}
5252
5353type 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
6160func 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.
150148func (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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments