restore proper lowercase/plural CRD resource (#2949)

* restore proper lowercase/plural CRD resource

This commit restores the proper resource string
"customresourcedefinitions" for CRD. The prior change to
"CustomResourceDefinition" was made because this was being used
in another place to populate the CRD "Kind" field in
remap_crd_version_action.go -- there, just use the correct Kind
string instead of pulling from Resource.

Signed-off-by: Scott Seago <sseago@redhat.com>

* add changelog

Signed-off-by: Scott Seago <sseago@redhat.com>
pull/2986/head
Scott Seago 2020-10-02 09:48:12 -04:00 committed by GitHub
parent 3867d1f434
commit d820bc5e72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1 @@
Restore CRD Resource name to fix CRD wait functionality.

View File

@ -31,7 +31,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
v1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/kuberesource"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
)
@ -111,7 +110,7 @@ func fetchV1beta1CRD(name string, betaCRDClient apiextv1beta1client.CustomResour
// See https://github.com/kubernetes/kubernetes/issues/3030. Unsure why this is happening here and not in main Velero;
// probably has to do with List calls and Dynamic client vs typed client
// Set these all the time, since they shouldn't ever be different, anyway
betaCRD.Kind = kuberesource.CustomResourceDefinitions.Resource
betaCRD.Kind = "CustomResourceDefinition"
betaCRD.APIVersion = apiextv1beta1.SchemeGroupVersion.String()
m, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&betaCRD)

View File

@ -23,7 +23,7 @@ import (
var (
ClusterRoleBindings = schema.GroupResource{Group: "rbac.authorization.k8s.io", Resource: "clusterrolebindings"}
ClusterRoles = schema.GroupResource{Group: "rbac.authorization.k8s.io", Resource: "clusterroles"}
CustomResourceDefinitions = schema.GroupResource{Group: "apiextensions.k8s.io", Resource: "CustomResourceDefinition"}
CustomResourceDefinitions = schema.GroupResource{Group: "apiextensions.k8s.io", Resource: "customresourcedefinitions"}
Jobs = schema.GroupResource{Group: "batch", Resource: "jobs"}
Namespaces = schema.GroupResource{Group: "", Resource: "namespaces"}
PersistentVolumeClaims = schema.GroupResource{Group: "", Resource: "persistentvolumeclaims"}