feat: enabled loading http-api-token from file (#1728)

This commit is contained in:
nils måsén 2023-08-12 19:19:08 +02:00 committed by GitHub
parent 139f67270b
commit 9f60766692
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View file

@ -466,6 +466,7 @@ func GetSecretsFromFiles(rootCmd *cobra.Command) {
"notification-msteams-hook",
"notification-gotify-token",
"notification-url",
"http-api-token",
}
for _, secret := range secrets {
if err := getSecretFromFile(flags, secret); err != nil {

View file

@ -90,6 +90,7 @@ func TestGetSliceSecretsFromFiles(t *testing.T) {
func testGetSecretsFromFiles(t *testing.T, flagName string, expected string, args ...string) {
cmd := new(cobra.Command)
SetDefaults()
RegisterSystemFlags(cmd)
RegisterNotificationFlags(cmd)
require.NoError(t, cmd.ParseFlags(args))
GetSecretsFromFiles(cmd)