Skip to content

Support patch with selector #909

@mbrancato

Description

@mbrancato

What would you like to be added:
I came across a use-case where I would like to patch multiple things at once. Without looking I did:

$ kubectl patch nodes ...
error: resource(s) were provided, but no name, label selector, or --all flag specified

So seeing that error, I quickly remedied it by adding a selector as the error says I should do:

$ kubectl patch nodes --selector='mylabel' ...
Error: unknown flag: --selector

Well, interesting.

Why is this needed:
This is obviously possible in a two step process with get nodes and a loop, but it would seem nice to be able to patch multiple things using a selector.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.sig/cliCategorizes an issue or PR as relevant to SIG CLI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions