rancher / support-bundle-kit

A toolkit to generate and analyze the support bundles for Kubernetes and Kubernetes-native applications
Apache License 2.0
17 stars 28 forks source link

Could not load support bundles with simulator #49

Closed bk201 closed 1 year ago

bk201 commented 1 year ago

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.

bk201 commented 1 year ago

Fixed with https://github.com/rancher/support-bundle-kit/pull/50