@@ -86,7 +86,7 @@ type UserOptions struct {
8686
8787// Configure will configure all the specified authentication Mechanisms. We need to ensure we wait for
8888// the agents to reach ready state after each operation as prematurely updating the automation config can cause the agents to get stuck.
89- func Configure (client kubernetesClient.Client , ctx context.Context , mdbNamespacedName * types.NamespacedName , conn om.Connection , opts Options , isRecovering bool , log * zap.SugaredLogger ) error {
89+ func Configure (client kubernetesClient.Client , ctx context.Context , mdbNamespacedName types.NamespacedName , conn om.Connection , opts Options , isRecovering bool , log * zap.SugaredLogger ) error {
9090 log .Infow ("ensuring correct deployment mechanisms" , "ProcessNames" , opts .ProcessNames , "Mechanisms" , opts .Mechanisms )
9191
9292 // In case we're recovering, we can push all changes at once, because the mechanism is triggered after 20min by default.
@@ -155,7 +155,7 @@ func Configure(client kubernetesClient.Client, ctx context.Context, mdbNamespace
155155
156156// Disable disables all authentication mechanisms, and waits for the agents to reach goal state. It is still required to provide
157157// automation agent username, password and keyfile contents to ensure a valid Automation Config.
158- func Disable (client kubernetesClient. Client , ctx context. Context , mdbNamespacedName * types.NamespacedName , conn om.Connection , opts Options , deleteUsers bool , log * zap.SugaredLogger ) error {
158+ func Disable (ctx context. Context , client kubernetesClient. Client , mdbNamespacedName types.NamespacedName , conn om.Connection , opts Options , deleteUsers bool , log * zap.SugaredLogger ) error {
159159 ac , err := conn .ReadAutomationConfig ()
160160 if err != nil {
161161 return xerrors .Errorf ("error reading automation config: %w" , err )
@@ -185,7 +185,7 @@ func Disable(client kubernetesClient.Client, ctx context.Context, mdbNamespacedN
185185 if err := ac .EnsureKeyFileContents (); err != nil {
186186 return xerrors .Errorf ("error ensuring keyfile contents: %w" , err )
187187 }
188- if _ , err := ac .EnsurePassword (client , ctx , mdbNamespacedName ); err != nil {
188+ if _ , err := ac .EnsurePassword (ctx , client , mdbNamespacedName ); err != nil {
189189 return xerrors .Errorf ("error ensuring agent password: %w" , err )
190190 }
191191
@@ -262,7 +262,7 @@ func removeUnsupportedAgentMechanisms(conn om.Connection, opts Options, log *zap
262262
263263// enableAgentAuthentication determines which agent authentication mechanism should be configured
264264// and enables it in Ops Manager
265- func enableAgentAuthentication (client kubernetesClient.Client , ctx context.Context , mdbNamespacedName * types.NamespacedName , conn om.Connection , opts Options , log * zap.SugaredLogger ) error {
265+ func enableAgentAuthentication (client kubernetesClient.Client , ctx context.Context , mdbNamespacedName types.NamespacedName , conn om.Connection , opts Options , log * zap.SugaredLogger ) error {
266266 ac , err := conn .ReadAutomationConfig ()
267267 if err != nil {
268268 return xerrors .Errorf ("error reading automation config: %w" , err )
@@ -369,14 +369,14 @@ func addOrRemoveAgentClientCertificate(conn om.Connection, opts Options, log *za
369369}
370370
371371// ensureAgentAuthenticationIsConfigured will configure the agent authentication settings based on the desiredAgentAuthMechanism
372- func ensureAgentAuthenticationIsConfigured (client kubernetesClient.Client , ctx context.Context , mdbNamespacedName * types.NamespacedName , conn om.Connection , opts Options , ac * om.AutomationConfig , mechanism Mechanism , log * zap.SugaredLogger ) error {
372+ func ensureAgentAuthenticationIsConfigured (client kubernetesClient.Client , ctx context.Context , mdbNamespacedName types.NamespacedName , conn om.Connection , opts Options , ac * om.AutomationConfig , mechanism Mechanism , log * zap.SugaredLogger ) error {
373373 if mechanism .IsAgentAuthenticationConfigured (ac , opts ) {
374374 log .Infof ("Agent authentication mechanism %s is already configured" , mechanism .GetName ())
375375 return nil
376376 }
377377
378378 log .Infof ("Enabling %s agent authentication" , mechanism .GetName ())
379- return mechanism .EnableAgentAuthentication (client , ctx , mdbNamespacedName , conn , opts , log )
379+ return mechanism .EnableAgentAuthentication (ctx , client , mdbNamespacedName , conn , opts , log )
380380}
381381
382382// ensureDeploymentMechanisms configures the given AutomationConfig to allow deployments to
0 commit comments