Skip to content

Commit

Permalink
Merge pull request #1846 from tnozicka/must-gatehr-nodes
Browse files Browse the repository at this point in the history
Collect nodes in must-gather
  • Loading branch information
scylla-operator-bot[bot] authored Apr 2, 2024
2 parents 2a1ca2e + a6cb4e6 commit 46ad46d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/cmd/operator/mustgather.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ var mustGatherSpecs = []struct {
Namespace: corev1.NamespaceAll,
Name: "",
},
{
GroupResource: schema.GroupResource{
Resource: "nodes",
Group: "",
},
Namespace: corev1.NamespaceAll,
Name: "",
},
{
GroupResource: schema.GroupResource{
Resource: "validatingwebhookconfigurations",
Expand Down
63 changes: 63 additions & 0 deletions pkg/cmd/operator/mustgather_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func TestMustGatherOptions_Run(t *testing.T) {
GroupVersion: corev1.SchemeGroupVersion.String(),
APIResources: []metav1.APIResource{
{Name: "namespaces", Namespaced: false, Kind: "Namespace", Verbs: []string{"list"}},
{Name: "nodes", Namespaced: false, Kind: "Node", Verbs: []string{"list"}},
{Name: "pods", Namespaced: true, Kind: "Pod", Verbs: []string{"list"}},
{Name: "secrets", Namespaced: true, Kind: "Secret", Verbs: []string{"list"}},
},
Expand Down Expand Up @@ -115,6 +116,11 @@ func TestMustGatherOptions_Run(t *testing.T) {
Name: "scylla-operator",
},
},
&corev1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "fedora",
},
},
&corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Namespace: "scylla-operator",
Expand Down Expand Up @@ -157,6 +163,32 @@ metadata:
name: scylla-operator
spec: {}
status: {}
`, "\n"),
},
{
Name: "cluster-scoped/nodes/fedora.yaml",
Content: strings.TrimPrefix(`
apiVersion: v1
kind: Node
metadata:
creationTimestamp: null
name: fedora
spec: {}
status:
daemonEndpoints:
kubeletEndpoint:
Port: 0
nodeInfo:
architecture: ""
bootID: ""
containerRuntimeVersion: ""
kernelVersion: ""
kubeProxyVersion: ""
kubeletVersion: ""
machineID: ""
operatingSystem: ""
osImage: ""
systemUUID: ""
`, "\n"),
},
{
Expand Down Expand Up @@ -225,6 +257,11 @@ metadata:
Name: "scylla-operator",
},
},
&corev1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "fedora",
},
},
&scyllav1.ScyllaCluster{
ObjectMeta: metav1.ObjectMeta{
Namespace: "my-namespace",
Expand Down Expand Up @@ -258,6 +295,32 @@ metadata:
name: scylla-operator
spec: {}
status: {}
`, "\n"),
},
{
Name: "cluster-scoped/nodes/fedora.yaml",
Content: strings.TrimPrefix(`
apiVersion: v1
kind: Node
metadata:
creationTimestamp: null
name: fedora
spec: {}
status:
daemonEndpoints:
kubeletEndpoint:
Port: 0
nodeInfo:
architecture: ""
bootID: ""
containerRuntimeVersion: ""
kernelVersion: ""
kubeProxyVersion: ""
kubeletVersion: ""
machineID: ""
operatingSystem: ""
osImage: ""
systemUUID: ""
`, "\n"),
},
{
Expand Down

0 comments on commit 46ad46d

Please sign in to comment.