resolve symlink

This commit is contained in:
Adphi 2020-11-21 12:36:08 +01:00
parent 9919c261f1
commit af626f35c4
3 changed files with 12 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
.idea
config.yml
config.sm.yaml

View File

@ -18,6 +18,8 @@ spec:
- /config/config.yml
image: adphi/go-repo
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8888
volumeMounts:
- mountPath: /config
name: config
@ -51,5 +53,6 @@ spec:
selector:
app: go-repo
ports:
- port: 8888
- port: 80
targetPort: 8888
type: LoadBalancer

View File

@ -2,6 +2,7 @@ package main
import (
"net/http"
"path/filepath"
"github.com/fsnotify/fsnotify"
"github.com/sirupsen/logrus"
@ -24,7 +25,11 @@ func main() {
if l, err := logrus.ParseLevel(level); err == nil {
logrus.SetLevel(l)
}
mods, err := NewModules(args[0])
path := args[0]
if s, err := filepath.EvalSymlinks(path); err == nil {
path = s
}
mods, err := NewModules(path)
if err != nil {
logrus.Fatal(err)
}
@ -69,7 +74,7 @@ func main() {
}
}
}()
if err := watcher.Add(args[0]); err != nil {
if err := watcher.Add(path); err != nil {
logrus.Fatal(err)
}
go func() {