Closed bk201 closed 1 year ago
FATA[0007] error loading cluster scoped objects error looking up GVR no matches for kind "Customresourcedefinition" in version "apiextensions.k8s.io/v1" for object &{map[apiVersion:apiextensions.k8s.io/v1 kind:Customresourcedefinition metadata:map[annotations:map[meta.helm.sh/release-name:harvester-crd meta.helm.sh/release-namespace:harvester-system objectset.rio.cattle.io/id:default-mcc-harvester-crd-cattle-fleet-local-system sim.harvesterhci.io/creationTimestamp:2022-11-08T07:09:10Z] creationTimestamp:2022-11-08T07:09:10Z generation:1 labels:map[app.kubernetes.io/managed-by:Helm objectset.rio.cattle.io/hash:d4a83267ddde6a8769c04362d4a0e5605db9baa7] managedFields:[map[apiVersion:apiextensions.k8s.io/v1 fieldsType:FieldsV1 fieldsV1:map[f:metadata:map[f:annotations:map[.:map[] f:meta.helm.sh/release-name:map[] f:meta.helm.sh/release-namespace:map[] f:objectset.rio.cattle.io/id:map[]] f:labels:map[.:map[] f:app.kubernetes.io/managed-by:map[] f:objectset.rio.cattle.io/hash:map[]]] f:spec:map[f:conversion:map[.:map[] f:strategy:map[]] f:group:map[] f:names:map[f:kind:map[] f:listKind:map[] f:plural:map[] f:singular:map[]] f:scope:map[] f:versions:map[]]] manager:fleetagent operation:Update time:2022-11-08T07:09:10Z] map[apiVersion:apiextensions.k8s.io/v1 fieldsType:FieldsV1 fieldsV1:map[f:status:map[f:acceptedNames:map[f:kind:map[] f:listKind:map[] f:plural:map[] f:singular:map[]] f:conditions:map[k:{"type":"Established"}:map[.:map[] f:lastTransitionTime:map[] f:message:map[] f:reason:map[] f:status:map[] f:type:map[]] k:{"type":"NamesAccepted"}:map[.:map[] f:lastTransitionTime:map[] f:message:map[] f:reason:map[] f:status:map[] f:type:map[]]]]] manager:kube-apiserver operation:Update subresource:status time:2022-11-08T07:09:10Z]] name:addons.harvesterhci.io uid:a45317f8-60f3-4891-82e5-de1df484991a] spec:map[conversion:map[strategy:None] group:harvesterhci.io names:map[kind:Addon listKind:AddonList plural:addons singular:addon] scope:Namespaced versions:[map[additionalPrinterColumns:[map[jsonPath:.spec.repo name:HelmRepo type:string] map[jsonPath:.spec.chart name:ChartName type:string] map[jsonPath:.spec.enabled name:Enabled type:boolean]] name:v1beta1 schema:map[openAPIV3Schema:map[properties:map[apiVersion:map[description:APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type:string] kind:map[description:Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type:string] metadata:map[type:object] spec:map[properties:map[chart:map[type:string] enabled:map[type:boolean] repo:map[type:string] valuesContent:map[type:string] version:map[type:string]] required:[chart enabled repo valuesContent version] type:object] status:map[properties:map[status:map[type:string]] type:object]] required:[spec] type:object]] served:true storage:true subresources:map[status:map[]]]]] status:map[acceptedNames:map[kind:Addon listKind:AddonList plural:addons singular:addon] conditions:[map[lastTransitionTime:2022-11-08T07:09:10Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2022-11-08T07:09:10Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v1beta1]]]}
The following is analysis from @Vicente-Cheng.
The generated kind names are not in upper camel case, for example:
$ cat yamls/namespaced/cattle-system/v1/serviceaccounts.yaml apiVersion: v1 items: - apiVersion: v1 kind: Serviceaccount <--- supposed to be ServiceAccount metadata: creationTimestamp: "2022-11-07T09:22:30Z"
$ cat yamls/cluster/apiextensions.k8s.io/v1/customresourcedefinitions.yaml apiVersion: v1 items: - apiVersion: apiextensions.k8s.io/v1 kind: Customresourcedefinition <--- supposed to be CustomResourceDefinition
This could be introduced since https://github.com/rancher/support-bundle-kit/commit/7048e68e1277a380a25f8dc915fe0b29a32385d2#diff-92be285ab4b27274a0724d7f89a21cd1aed1a40d670c4e3afad3475a640cf0f5R80 The cases.Title function converts the first letter of each word in a sentence to upper case. For example, The generated kind to The Generated Kind. And it converts CustomResourceDefinition to Customresourcedefinition.
cases.Title
The generated kind
The Generated Kind
CustomResourceDefinition
Customresourcedefinition
Fixed with https://github.com/rancher/support-bundle-kit/pull/50
The following is analysis from @Vicente-Cheng.
The generated kind names are not in upper camel case, for example:
This could be introduced since https://github.com/rancher/support-bundle-kit/commit/7048e68e1277a380a25f8dc915fe0b29a32385d2#diff-92be285ab4b27274a0724d7f89a21cd1aed1a40d670c4e3afad3475a640cf0f5R80 The
cases.Title
function converts the first letter of each word in a sentence to upper case. For example,The generated kind
toThe Generated Kind
. And it convertsCustomResourceDefinition
toCustomresourcedefinition
.