From 4a9b31f3b48f1689bb348da494fb8ebfd01c2795 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 28 Apr 2022 08:49:44 +0200 Subject: [PATCH] fix machineauth to right machine auth api key --- .../auth-machine/pkg/config/defaults/defaultconfig.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/auth-machine/pkg/config/defaults/defaultconfig.go b/extensions/auth-machine/pkg/config/defaults/defaultconfig.go index 9f85d6720b..14be9c67d1 100644 --- a/extensions/auth-machine/pkg/config/defaults/defaultconfig.go +++ b/extensions/auth-machine/pkg/config/defaults/defaultconfig.go @@ -76,9 +76,9 @@ func EnsureDefaults(cfg *config.Config) { cfg.TokenManager = &config.TokenManager{} } - if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" { - cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey - } else if cfg.MachineAuthAPIKey == "" { + if cfg.AuthProviders.Machine.APIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" { + cfg.AuthProviders.Machine.APIKey = cfg.Commons.MachineAuthAPIKey + } else if cfg.AuthProviders.Machine.APIKey == "" { log.Fatalf("machine auth api key is not set up properly, bailing out (%s)", cfg.Service.Name) } }