diff --git a/README.md b/README.md index 30fe966..ea60205 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,8 @@ If both are specified, APPSODY_CONTROLLER_IMAGE will be used. If the appsody stack of interest uses a script file (.sh for example) that is then edited by the `vi` editor while the script is running, the file modification time is not updated on the container file system until the script ends. What this means is that the ON_CHANGE action is not triggered when `vi` writes the file. +The vender watcher package code used by the controller uses filepath.Walk function from the path/filepath package to traverse the file system. This function does not evaluate symlinks. If the APPSODY_WATCH_DIR is a symlink or contains files and directories that are symlinks, it is possible that unexpected behavior may occur during file watching as the watcher may not be able to traverse symlinks or detect changes in the underlying file referenced by the symlink as expected. + ## Contributing We welcome all contributions to the Appsody project. Please see our [Contributing guidelines](https://github.com/appsody/docs/blob/master/CONTRIBUTING.md) diff --git a/main.go b/main.go index 9a4ec02..908835b 100644 --- a/main.go +++ b/main.go @@ -180,7 +180,10 @@ func computeSigInt(tempSigInt string) bool { func setupEnvironmentVars() error { var err error - + appsodySeparator := os.Getenv("APPSODY_MOUNT_SEPARATOR") + if appsodySeparator == "" { + appsodySeparator = ";" + } tmpWATCHIGNOREDIR := os.Getenv("APPSODY_WATCH_IGNORE_DIR") appsodyRUNKILL = computeSigInt(os.Getenv("APPSODY_RUN_KILL")) appsodyDEBUGKILL = computeSigInt(os.Getenv("APPSODY_DEBUG_KILL")) @@ -249,7 +252,7 @@ func setupEnvironmentVars() error { // split the watch dirs using ; separator if tmpWatchDirs != "" { - appsodyWATCHDIRS = strings.Split(tmpWatchDirs, ";") + appsodyWATCHDIRS = strings.Split(tmpWatchDirs, appsodySeparator) for i := 0; i < len(appsodyWATCHDIRS); i++ { appsodyWATCHDIRS[i] = strings.TrimSpace(appsodyWATCHDIRS[i]) @@ -258,7 +261,7 @@ func setupEnvironmentVars() error { } if tmpWATCHIGNOREDIR != "" { - appsodyWATCHIGNOREDIR = strings.Split(tmpWATCHIGNOREDIR, ";") + appsodyWATCHIGNOREDIR = strings.Split(tmpWATCHIGNOREDIR, appsodySeparator) for i := 0; i < len(appsodyWATCHIGNOREDIR); i++ { appsodyWATCHIGNOREDIR[i] = strings.TrimSpace(appsodyWATCHIGNOREDIR[i]) @@ -269,7 +272,7 @@ func setupEnvironmentVars() error { // split the mount dirs using ; separator if tmpMountDirs != "" { - appsodyMOUNTS = strings.Split(tmpMountDirs, ";") + appsodyMOUNTS = strings.Split(tmpMountDirs, appsodySeparator) for i := 0; i < len(appsodyMOUNTS); i++ { // check if there is a : separator if strings.Contains(appsodyMOUNTS[i], ":") {