Re: [kubernetes/kubernetes] `kubectl create -f` and `kubectl delete -f` are not glob friendly (#12123)

1 view
Skip to first unread message

Michail Kargakis

unread,
Jun 9, 2017, 1:02:38 PM6/9/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@kubernetes/sig-cli-misc


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

fejta-bot

unread,
Dec 26, 2017, 1:20:21 PM12/26/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

Tim Hockin

unread,
Dec 27, 2017, 3:04:40 PM12/27/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@pwittrock Keep or kill?

Brian Grant

unread,
Jan 22, 2018, 4:47:58 PM1/22/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/remove-lifecycle stale
/lifecycle frozen

See also #24649.

Clayton Coleman

unread,
May 1, 2018, 10:13:22 PM5/1/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I didn't even think about this until now, but I think we can fix this by using the args termination --:

$ find . -name *something* | kubectl create --

This would be roughly consistent with git and other commands that terminate flag processing at --. This would not be backwards incompatible with our existing commands (create, delete, get, describe, apply, replace).

Joe Marty

unread,
Apr 21, 2020, 5:07:01 PM4/21/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Kinda seems like you did think of it before 😄 (Or maybe there's a distinction I'm missing!) In any case, I like it! Until there's a solution, here's an xargs example:

find ingresses/*.yaml -print0 | xargs -0 -L1 kubectl apply -f

(-print0 and -0 flags are only needed if your filenames have spaces or newlines in them, so that both programs use null characters as a separator instead of the default whitespace separator)


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Antoine Pelisse

unread,
Feb 4, 2021, 11:36:49 AM2/4/21
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

For what it's worth, git does it's own globbing on top of shell expansion, e.g.

git diff -- '*.go' # single quotes prevents shell expansion

Eddie Zaneski

unread,
Mar 31, 2021, 12:38:42 PM3/31/21
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

We would accept a PR with @apelisse's above solution.

/triage accepted
/help

Kubernetes Prow Robot

unread,
Mar 31, 2021, 12:38:45 PM3/31/21
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@eddiezane:
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.

In response to this:

We would accept a PR with @apelisse's above solution.

/triage accepted
/help

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.

Daniel

unread,
May 24, 2021, 11:13:38 AM5/24/21
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I would like to take this @eddiezane
cc @seans3 @mengqiy

Eddie Zaneski

unread,
May 24, 2021, 2:17:21 PM5/24/21
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/assign @danielrodriguez

Feel free to reach out on Slack if you need help.

Justin Garrison

unread,
Jun 17, 2021, 2:11:22 PM6/17/21
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Personally, I like the option to use shell globbing and make kubectl more glob friendly. I read through the other issue with options and I'm in favor of supporting positional arguments (space separated) after -f and until another option is passed. There are plenty of 1 liners and pipes that could make this work (xargs, tr) but the simplicity of space or new line separated file names is less surprising and more integrated into shell environments.

kubectl apply -f ./*deploy.yaml --namespace foo

is that more or less surprising than other tools?

ls ./*deploy*
mv *deploy.yaml folder/
cp .* hidden/

Requiring quotes makes subshell replacement work in a different way than if we accepted a list of files.

kubectl apply -f $(git grep -L deploy)

Accepting a space or newline separated list matches a lot of other shell functionality and IMO is less surprising. I'm not sure if there are any positional args in kubectl currently that this could cause problems with but file lists would be my preference.

Chok Yip Lau

unread,
Feb 8, 2022, 10:44:15 PM2/8/22
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/assign


Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issues/12123/1033313350@github.com>

Kubernetes Prow Robot

unread,
Mar 27, 2022, 10:41:43 PM3/27/22
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Closed #12123 via #102265.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issue/12123/issue_event/6314878443@github.com>

Reply all
Reply to author
Forward
0 new messages