rancher / support-bundle-kit

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

[BUG] Simulator is unable to load supportconfig #122

Open starbops opened 3 months ago

starbops commented 3 months ago

Problem Description

While loading the support bundle with the simulator, the following errors appeared near the end of the resource loading progress (sensitive information are scrubbed):

...
E0805 04:15:01.751964       7 fieldmanager.go:152] "[SHOULD NOT HAPPEN] failed to update managedFields" err="failed to convert new object (support-bundle-node-info/xxx; /v1, Kind=Pod) to smd typed: .spec.containers: duplicate entries for key [name=\"kernel\"]" versionKind="/, Kind=" namespace="support-bundle-node-info" name="xxx"
ERRO[2704] error during creation of resource xxx with gvr /v1, Resource=pods  error="Pod \"xxx\" is invalid: [spec.containers[1].name: Invalid value: \"scc_supportconfig_xxx.txz\": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?'), spec.containers[8].name: Duplicate value: \"kernel\"]"
ERRO[2704] error during creation of resource yyy with gvr /v1, Resource=pods  error="Pod \"yyy\" is invalid: [spec.containers[7].name: Duplicate value: \"kernel\", spec.containers[8].name: Invalid value: \"scc_supportconfig_yyy.txz\": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?'), spec.containers[9].name: Duplicate value: \"kernel\"]"
...

One of the problem seems to be related to the naming of the supportconfig file. The underscore character is not a valid character in RFC 1123.

Expected Behaviors

The support-bundle-kit simulator should load the SB successfully without the above error messages.

Environment

starbops commented 3 months ago

A similar issue has already been raised: #93. This one is more specific about the support config loading error.