Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't replicate kubectl apply -f functionality with Python client #1028

Closed
@Datamance

Description

@Datamance

What happened (please include outputs or screenshots):
The kubectl CLI uses a StrategicMergePatch type in the underlying API request for apply.

The Python client should be able to do the same by letting us pass a Content-Type of 'application/strategic-merge-patch+json' into the headers dict, but this odd little piece of generated code precludes us from doing so

header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501

I would like to leverage the Python client as much as possible without resorting to kubectl. Is there a way to get around this for the time being?

Thanks in advance!

Environment:

  • Kubernetes version (kubectl version):

  • OS (e.g., MacOS 10.13.6):
    10.15.1

  • Python version (python --version)
    3.8.0

  • Python client version (pip list | grep kubernetes)
    10.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions