Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Allow for a Mount separator other than ';' #61

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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])

Expand All @@ -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])

Expand All @@ -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], ":") {
Expand Down