Skip to content

Conversation

@shahar-h
Copy link

Description, Motivation and Context

image

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)
  • The commit message(s) are informative and highlight any breaking changes
  • Any documentation required has been added/updated. For changes to https://troubleshoot.sh/ create a PR here

Does this PR introduce a breaking change?

  • Yes
  • No

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing v1beta3 scheme registration breaks decoding

The troubleshootv1beta3.AddToScheme call was removed from localSchemeBuilder, but pkg/loader/loader.go still imports and uses troubleshootv1beta3 types and explicitly calls troubleshootv1beta3.AddToScheme(scheme.Scheme) in its init function. The loader also attempts to decode v1beta3 specs using loadV1Beta3Spec. Removing v1beta3 from the clientset scheme registration creates an inconsistency where v1beta3 types are registered in the loader's scheme but not in the clientset's scheme, potentially causing decoding failures when the clientset scheme is used elsewhere in the codebase.

pkg/client/troubleshootclientset/scheme/register.go#L32-L36

var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
troubleshootv1beta1.AddToScheme,
troubleshootv1beta2.AddToScheme,
}

Fix in Cursor Fix in Web


Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: v1beta3 types removed from scheme registration

The troubleshootv1beta3 import and its AddToScheme call were removed from the localSchemeBuilder, but troubleshootv1beta3 types are still actively used in pkg/loader/loader.go. This creates an inconsistency where the exported AddToScheme function won't register v1beta3 types, potentially breaking code that relies on the scheme's AddToScheme to register all troubleshoot API versions. While the loader manually registers v1beta3 in its own init function, other consumers of the scheme package may fail to decode v1beta3 resources.

pkg/client/troubleshootclientset/scheme/register.go#L32-L36

var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
troubleshootv1beta1.AddToScheme,
troubleshootv1beta2.AddToScheme,
}

Fix in Cursor Fix in Web


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants