Skip to content

Commit

Permalink
image: Fix context hash of symlinks in subdirs
Browse files Browse the repository at this point in the history
Fixes #541.

Evaluates symlinks using the full path to the file, not the incorrect relative
path to the context dir. The provider's current working directory and the
context dir are likely to be different. Regular files are treated similarly:

https://github.com/pulumi/pulumi-docker/blob/8cd8688eaee94c588d65f18862d95a1b0ff3f247/provider/provider.go#L455-L460
  • Loading branch information
AaronFriel committed Mar 14, 2023
1 parent efb56a7 commit e8d2547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ func (accumulator *contextHashAccumulator) hashPath(path string, fileMode fs.Fil
// a) ignore changes at the symlink target
// b) detect if the symlink _itself_ changes
// c) avoid a panic on io.Copy if the symlink target is a directory
symLinkPath, err := filepath.EvalSymlinks(path)
symLinkPath, err := filepath.EvalSymlinks(filepath.Join(accumulator.dockerContextPath, path))
if err != nil {
return fmt.Errorf("could not evaluate symlink at %s: %w", path, err)
}
Expand Down

0 comments on commit e8d2547

Please sign in to comment.