Skip to content

Support customizing “Accept” header #1428

Description

@roycaihw

What is the feature and why do you need it:
From a conversation in slack. Kubernetes client-go has a metadata client that only retrieves object metadata from the API server. It helps in scenarios where the user only cares about object metadata and wants to reduce the client-side deserialization time. The easiest way to support this feature in the Python client is to do it in the dynamic client.

Describe the solution you'd like to see:
The dynamic client hard-codes the Accept header. We can have a new parameter to allow overwriting the value like how the metadata client does:

SetHeader("Accept", "application/vnd.kubernetes.protobuf;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1,application/json").

The solution should be e2e tested.

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature.
    on Apr 26, 2021
  2. roycaihw commented on Apr 26, 2021

    @roycaihw
    MemberAuthor
  3. k8s-ci-robot commented on Apr 26, 2021

    @k8s-ci-robot
    Contributor

    @roycaihw:
    This request has been marked as needing help from a contributor.

    Please ensure the request meets the requirements listed here.

    If this request no longer meets these requirements, the label can be removed
    by commenting with the /remove-help command.

    Details

    In response to this:

    /help

    cc @Yashks1994 @Priyankasaggu11929

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

  4. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Apr 26, 2021
  5. Yashks1994 commented on Apr 26, 2021

    @Yashks1994
    Contributor

    /assign

  6. added
    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.
    on Apr 26, 2021
  7. Yashks1994 commented on Apr 27, 2021

    @Yashks1994
    Contributor

    Opened a PR- kubernetes-client/python-base#236 to accept the header.

  8. roycaihw commented on May 7, 2021

    @roycaihw
    MemberAuthor
  9. added a commit that references this issue on Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions