"Username is specified in both config and secret ..." and similar warning messages are incorrectly logged after updating Trident v22.07.0.
time="2022-08-01T01:42:13Z" level=warning msg="clientPrivateKey is specified in both config and secret; overriding from secret."
time="2022-08-01T01:42:13Z" level=warning msg="Username is specified in both config and secret; overriding from secret."
time="2022-08-01T01:42:13Z" level=warning msg="Password is specified in both config and secret; overriding from secret."
It seems that this behavior is introduced in https://github.com/NetApp/trident/commit/655e707d26e047df7809740f05f1f984bb36cb1f. Apparently, this commit assumes ClientPrivateKey, Username, and Password in OntapStorageDriverConfig are empty if the backend secret is used. But these fields have values like secret:tbe-3282edab-7edf-46ef-b57d-eb134fa5bbd0 if we use the backend secret, so these warning messages are always logged.
time="2022-08-08T07:24:37Z" level=warning msg="Username is specified in both config and secret; overriding from secret."
time="2022-08-08T07:24:37Z" level=warning msg="Password is specified in both config and secret; overriding from secret."
Expected behavior
Trident should not log these warning messages when we only use the backend secret.
Describe the bug
"Username is specified in both config and secret ..." and similar warning messages are incorrectly logged after updating Trident v22.07.0.
It seems that this behavior is introduced in https://github.com/NetApp/trident/commit/655e707d26e047df7809740f05f1f984bb36cb1f. Apparently, this commit assumes
ClientPrivateKey
,Username
, andPassword
in OntapStorageDriverConfig are empty if the backend secret is used. But these fields have values likesecret:tbe-3282edab-7edf-46ef-b57d-eb134fa5bbd0
if we use the backend secret, so these warning messages are always logged.Environment
silenceAutosupport: true
(Trident Operator)To Reproduce
Expected behavior
Trident should not log these warning messages when we only use the backend secret.