mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-05 20:07:54 +00:00
Compare commits
1 Commits
4c369587a3
...
dev/PT-193
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c8b8212196 |
@@ -166,12 +166,12 @@ func (d *Dumper) DumpCluster() error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
location = filepath.Join(d.location, ns.Name, pod.Name, "/pt-summary.txt")
|
location = filepath.Join(d.location, ns.Name, pod.Name, "/pt-summary.txt")
|
||||||
component := d.crType
|
component := resourceType(d.crType)
|
||||||
if d.crType == "psmdb" {
|
if component == "psmdb" {
|
||||||
component = "mongod"
|
component = "mongod"
|
||||||
}
|
}
|
||||||
if pod.Labels["app.kubernetes.io/component"] == component {
|
if pod.Labels["app.kubernetes.io/component"] == component {
|
||||||
output, err = d.getPodSummary(d.crType, pod.Name, pod.Labels["app.kubernetes.io/instance"], tw)
|
output, err = d.getPodSummary(resourceType(d.crType), pod.Name, pod.Labels["app.kubernetes.io/instance"], tw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
d.logError(err.Error(), d.crType, pod.Name)
|
d.logError(err.Error(), d.crType, pod.Name)
|
||||||
err = addToArchive(location, d.mode, []byte(err.Error()), tw)
|
err = addToArchive(location, d.mode, []byte(err.Error()), tw)
|
||||||
@@ -353,3 +353,12 @@ func (d *Dumper) getDataFromSecret(secretName, dataName string) (string, error)
|
|||||||
|
|
||||||
return string(pass), nil
|
return string(pass), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func resourceType(s string) string {
|
||||||
|
if s == "pxc" || strings.HasPrefix(s, "pxc/") {
|
||||||
|
return "pxc"
|
||||||
|
} else if s == "psmdb" || strings.HasPrefix(s, "psmdb/") {
|
||||||
|
return "psmdb"
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user