Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.
This repository was archived by the owner on May 14, 2026. It is now read-only.

Bug: kubeCmdFactory will lose WrapTransport config #620

Description

@a244591052

func kubeCmdFactory(kubeconfig, ns string, config *rest.Config) cmdutil.Factory {
kubeConfigFlags := genericclioptions.NewConfigFlags(true)
if ns != "" {
kubeConfigFlags.Namespace = &ns
}
kubeConfigFlags.KubeConfig = &kubeconfig
kubeConfigFlags.WithDiscoveryBurst(config.Burst)
kubeConfigFlags.WithDiscoveryQPS(config.QPS)
matchVersionKubeConfigFlags := cmdutil.NewMatchVersionFlags(kubeConfigFlags)
return cmdutil.NewFactory(matchVersionKubeConfigFlags)
}

In the above code, WrapTransport is not passed, which will cause the client corresponding to the NewFactory to have no WrapTransport, which is not as expected.

In addition, RateLimiter is not passed, which will cause the NewFactory client to create a new RateLimiter using the passed in QPS. If k8s is limiting the flow for the client, then it is expected. If k8s is limiting the flow for the IP address, then RateLimiter should be passed.

fix pr: #622

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions