mirror of
https://github.com/containrrr/watchtower.git
synced 2026-03-03 11:20:17 +01:00
feat(shoutrrr): fix notification url files and tests
This commit is contained in:
parent
624e2a744a
commit
e2b963e2aa
2 changed files with 31 additions and 5 deletions
|
|
@ -390,16 +390,14 @@ func GetSecretsFromFiles(rootCmd *cobra.Command) {
|
|||
|
||||
// getSecretFromFile will check if the flag contains a reference to a file; if it does, replaces the value of the flag with the contents of the file.
|
||||
func getSecretFromFile(flags *pflag.FlagSet, secret string) {
|
||||
value, err := flags.GetString(secret)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
flag := flags.Lookup(secret)
|
||||
value := flag.Value.String()
|
||||
if value != "" && isFile(value) {
|
||||
file, err := ioutil.ReadFile(value)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
flag := flags.Lookup(secret)
|
||||
|
||||
if flag.Value.Type() == "stringArray" {
|
||||
rows := bytes.Split(file, []byte{'\n'})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue