Closed varunsrinivasan2 closed 4 months ago
Please add a release note.
Can you give an example on what the user should set in the configmap?
@varunsrinivasan2 Can you update the documentation?
Can you give an example on what the user should set in the configmap?
@xing-yang updated comment with example.
@varunsrinivasan2 Can you update the documentation?
Will do.
What this PR does / why we need it: This PR addresses the issue when vSphere login credentials contain Go escape characters (e.g.
\
or\n
). The credentials are read from a configuration file where the keys, suchuser
andpassword
, are stored with values that are quoted. The values need to be read without quotes, but when the value contains a Go escape character, thestrconv.Unquote
method may fail in certain cases causing cascading errors due to login failures. In this change, theParseLines
function is removed and aParseConfig
function is introduced. TheParseConfig
function takes in the Kubernetes Secret and the empty map of params from the original caller. To be consistent with vSphere's CSI plugin, a newVCConfig struct
is introduced to hold the configuration data and the function will use thegcfg
package to read the configuration data which will handle unquoting the strings. It will then iterate over theVCConfig struct
to assign the values to the necessary keys to allow the plugin to connect to VC.Example: If VC password is
}sso\d$2!UsO
Configuration file should escape with\\
as such:Testing:
Pods are in running state when using password with escape character, tested with passwords escaped in conf file as described in this Github Issue from vSphere's CSI plugin: https://github.com/kubernetes-sigs/vsphere-csi-driver/issues/121
Successful backup:
Succesful restore:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: