litmus icon indicating copy to clipboard operation
litmus copied to clipboard

agent: new ACCESS_KEY not updated in secret

Open gdsoumya opened this issue 2 years ago • 0 comments

What happened:

After the initial cluster registration operation, the agent updates the config with the new access key. This PR https://github.com/litmuschaos/litmus/pull/3492 broke the config update by moving the ACESS_KEY env var to a secret, the agent is still updating the access key in the configmap instead of the secret

Might be a critical bug depending on which env is prioritized(secret or the cm) when the agent restarts, because if the secret is prioritized the agent will be using the old access key causing the authentication to fail.

What you expected to happen:

Agent updates the new ACCESS_KEY in the `agent-secret instead of configmap

Where can this issue be corrected? (optional)

Ref: https://github.com/litmuschaos/litmus/blob/master/litmus-portal/cluster-agents/subscriber/pkg/k8s/operations.go#L155-L173

In the above function, we need to remove the access key and cluster id env var from the configmap and update it in the secret instead

How to reproduce it (as minimally and precisely as possible):

Install litmus and let the agent perform the registration, once active check the secret and config maps for the agent

gdsoumya avatar Mar 28 '22 09:03 gdsoumya