mirror of https://github.com/kubernetes/kops.git
kubetest: dump poddisruptionbudgets and fieldManagers
Should help diagnose what's going on in some of our complex upgrade tests when we detect conflicts. Issue #14520
This commit is contained in:
parent
3e5131ecdf
commit
f887d51996
|
|
@ -121,6 +121,7 @@ func (d *deployer) dumpClusterInfo() error {
|
||||||
args = []string{
|
args = []string{
|
||||||
"kubectl", "--request-timeout", "5s", "get", resType,
|
"kubectl", "--request-timeout", "5s", "get", resType,
|
||||||
"--all-namespaces",
|
"--all-namespaces",
|
||||||
|
"--show-managed-fields",
|
||||||
"-o", "yaml",
|
"-o", "yaml",
|
||||||
}
|
}
|
||||||
klog.Info(strings.Join(args, " "))
|
klog.Info(strings.Join(args, " "))
|
||||||
|
|
@ -141,7 +142,14 @@ func (d *deployer) dumpClusterInfo() error {
|
||||||
return fmt.Errorf("failed to get namespaces: %s", err)
|
return fmt.Errorf("failed to get namespaces: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
namespacedResourceTypes := []string{"configmaps", "endpoints", "endpointslices", "leases", "persistentvolumeclaims"}
|
namespacedResourceTypes := []string{
|
||||||
|
"configmaps",
|
||||||
|
"endpoints",
|
||||||
|
"endpointslices",
|
||||||
|
"leases",
|
||||||
|
"persistentvolumeclaims",
|
||||||
|
"poddisruptionbudgets",
|
||||||
|
}
|
||||||
for _, namespace := range namespaces {
|
for _, namespace := range namespaces {
|
||||||
namespace = strings.TrimSpace(namespace)
|
namespace = strings.TrimSpace(namespace)
|
||||||
if err := os.MkdirAll(path.Join(d.ArtifactsDir, "cluster-info", namespace), 0o755); err != nil {
|
if err := os.MkdirAll(path.Join(d.ArtifactsDir, "cluster-info", namespace), 0o755); err != nil {
|
||||||
|
|
@ -157,6 +165,7 @@ func (d *deployer) dumpClusterInfo() error {
|
||||||
args = []string{
|
args = []string{
|
||||||
"kubectl", "get", resType,
|
"kubectl", "get", resType,
|
||||||
"-n", namespace,
|
"-n", namespace,
|
||||||
|
"--show-managed-fields",
|
||||||
"-o", "yaml",
|
"-o", "yaml",
|
||||||
}
|
}
|
||||||
klog.Info(strings.Join(args, " "))
|
klog.Info(strings.Join(args, " "))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue