Skip to content

WatchConfig and Kubernetes #284

@anopheles

Description

@anopheles

I've mounted a Kubernetes ConfigMap to the directory /configuration/sub/ which contains the file "config.yaml"

I've pointed by config directory to /configuration/sub/. When I delete the ConfigMap and create a new one following events are emitted:

`EVENT
"/configuration/sub/..129812_06_12_09_48_04.149851493": CREATE
/configuration/sub/..129812_06_12_09_48_04.149851493
/configuration/sub/config.yaml

EVENT
"/configuration/sub/..129812_06_12_09_48_04.149851493": CHMOD
/configuration/sub/..129812_06_12_09_48_04.149851493
/configuration/sub/config.yaml

EVENT
"/configuration/sub/..data_tmp": RENAME
/configuration/sub/..data_tmp
/configuration/sub/config.yaml

EVENT
"/configuration/sub/..data": CREATE
/configuration/sub/..data
/configuration/sub/config.yaml

EVENT
"/configuration/sub/..129812_06_12_09_46_53.419174284": REMOVE
/configuration/sub/..129812_06_12_09_46_53.419174284
/configuration/sub/config.yaml
`

Is there a way to tell viper to watch for directory modifications and simply reload the config file?

Config is simply a simplink to /..data/
root@go-config-template-425445534-wyuxo:/configuration/sub# ls -lah
total 12K
drwxrwxrwx 3 root root 4.0K Dec 6 10:14 .
drwxr-xr-x 3 root root 4.0K Dec 6 09:46 ..
drwxr-xr-x 2 root root 4.0K Dec 6 10:14 ..129812_06_12_10_14_35.092642688
lrwxrwxrwx 1 root root 33 Dec 6 10:14 ..data -> ..129812_06_12_10_14_35.092642688
lrwxrwxrwx 1 root root 18 Dec 6 09:46 config.yaml -> ..data/config.yaml
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions