Skip to content

Commit

Permalink
Merge pull request #1562 from tnozicka/must-gather-crds
Browse files Browse the repository at this point in the history
Collect CRDs in must-gather
  • Loading branch information
scylla-operator-bot[bot] authored Nov 13, 2023
2 parents 29aa440 + ec289d5 commit 127c45f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ require (
google.golang.org/grpc v1.59.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.28.3
k8s.io/apiextensions-apiserver v0.26.2
k8s.io/apimachinery v0.28.3
k8s.io/apiserver v0.28.3
k8s.io/cli-runtime v0.28.3
Expand Down Expand Up @@ -165,7 +166,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.2 // indirect
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
8 changes: 8 additions & 0 deletions pkg/cmd/operator/mustgather.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ var mustGatherSpecs = []struct {
Namespace: corev1.NamespaceAll,
Name: "scylla-manager",
},
{
GroupResource: schema.GroupResource{
Resource: "customresourcedefinitions",
Group: "apiextensions.k8s.io",
},
Namespace: corev1.NamespaceAll,
Name: "",
},
{
GroupResource: schema.GroupResource{
Resource: "validatingwebhookconfigurations",
Expand Down
12 changes: 12 additions & 0 deletions pkg/cmd/operator/mustgather_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
apiserverinternalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -41,6 +42,12 @@ func TestMustGatherOptions_Run(t *testing.T) {
{Name: "secrets", Namespaced: true, Kind: "Secret", Verbs: []string{"list"}},
},
},
{
GroupVersion: apiextensions.SchemeGroupVersion.String(),
APIResources: []metav1.APIResource{
{Name: "customresourcedefinitions", Namespaced: false, Kind: "CustomResourceDefinition", Verbs: []string{"list"}},
},
},
{
GroupVersion: admissionregistrationv1.SchemeGroupVersion.String(),
APIResources: []metav1.APIResource{
Expand Down Expand Up @@ -76,6 +83,11 @@ func TestMustGatherOptions_Run(t *testing.T) {
t.Fatal(err)
}

err = apiextensions.AddToScheme(testScheme)
if err != nil {
t.Fatal(err)
}

err = scyllav1alpha1.Install(testScheme)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 127c45f

Please sign in to comment.