mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-19 18:34:59 +00:00
PT-2299 - collect openssl x509 certificate information for each secret
- Added resourceType to the switch calls as suggested by Nickolay
This commit is contained in:
@@ -74,7 +74,7 @@ func New(location, namespace, resource string, kubeconfig string, forwardport st
|
|||||||
"persistentvolumes",
|
"persistentvolumes",
|
||||||
}
|
}
|
||||||
|
|
||||||
switch resource {
|
switch resourceType(resource) {
|
||||||
case "auto":
|
case "auto":
|
||||||
result, err := d.runCmd("api-resources", "-o", "name")
|
result, err := d.runCmd("api-resources", "-o", "name")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -124,7 +124,7 @@ func New(location, namespace, resource string, kubeconfig string, forwardport st
|
|||||||
}
|
}
|
||||||
sslSecrets := make([]sslSecret, 0)
|
sslSecrets := make([]sslSecret, 0)
|
||||||
filePaths := make([]string, 0)
|
filePaths := make([]string, 0)
|
||||||
switch resource {
|
switch resourceType(resource) {
|
||||||
case "pg":
|
case "pg":
|
||||||
sslSecrets = append(sslSecrets,
|
sslSecrets = append(sslSecrets,
|
||||||
sslSecret{
|
sslSecret{
|
||||||
@@ -652,7 +652,9 @@ func (d *Dumper) getSSLCertificates(secret sslSecret, namespace string, tw *tar.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func resourceType(s string) string {
|
func resourceType(s string) string {
|
||||||
if s == "pxc" || strings.HasPrefix(s, "pxc/") {
|
if s == "auto" {
|
||||||
|
return "auto"
|
||||||
|
} else if s == "pxc" || strings.HasPrefix(s, "pxc/") {
|
||||||
return "pxc"
|
return "pxc"
|
||||||
} else if s == "psmdb" || strings.HasPrefix(s, "psmdb/") {
|
} else if s == "psmdb" || strings.HasPrefix(s, "psmdb/") {
|
||||||
return "psmdb"
|
return "psmdb"
|
||||||
|
Reference in New Issue
Block a user