forked from vmware-tanzu/velero-plugin-for-vsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify parsing behavior of login credentials to handle Go escape char…
…acters (vmware-tanzu#564) * Signed-off-by: Varun Srinivasan <varuns6@vmware.com> Create common config and new function to parse config data * Always populate "port" key of parameters map after setting default VC port if config port value is empty Signed-off-by: Varun Srinivasan <varuns6@vmware.com> * Clean up test logging and unit tests Signed-off-by: Varun Srinivasan <varuns6@vmware.com> * Keep only necessary config values Signed-off-by: Varun Srinivasan <varuns6@vmware.com> * Refactor ParseConfig to return error for sanitized error handling Signed-off-by: Varun Srinivasan <varuns6@vmware.com> --------- Signed-off-by: Varun Srinivasan <varuns6@vmware.com>
- Loading branch information
1 parent
3de8dbe
commit 5ea96ad
Showing
5 changed files
with
100 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package config | ||
|
||
type Config struct { | ||
Global struct { | ||
VCenterIP string `gcfg:"ip"` | ||
ClusterID string `gcfg:"cluster-id"` | ||
ClusterDistribution string `gcfg:"cluster-distribution"` | ||
CAFile string `gcfg:"ca-file"` | ||
} | ||
// Virtual Center configurations | ||
VirtualCenter map[string]*VirtualCenterConfig | ||
} | ||
|
||
type VirtualCenterConfig struct { | ||
User string `gcfg:"user"` | ||
Password string `gcfg:"password"` | ||
VCenterPort string `gcfg:"port"` | ||
InsecureFlag bool `gcfg:"insecure-flag"` | ||
Datacenters string `gcfg:"datacenters"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters