Commit Graph

41 Commits

Author SHA1 Message Date
Arda Güçlü 4c8c153513 Wire context to logs command and add interrupt handler (#127503)
* Wire context to logs command and add interrupt handler

* Move conditional outside of interrupt handler

Kubernetes-commit: 5826868586d501060a6151d04c511236b11a26d4
2024-10-22 21:49:06 +03:00
Maciej Szulik b3015b8e3e Remove deprecated kubectl run flags
This commits removes the following flags from kubectl run:
- filename
- force
- grace-period
- kustomize
- recursive
- timeout
- wait

Those flags are deprecated since v1.26, see this commit
09804a198c.

Kubernetes-commit: f1917f18eb715353610b6dfa0744698fa3fa7654
2024-06-26 17:42:13 +02:00
Davanum Srinivas 1fb897b3e0 New repo who dis? distribution/reference
github.com/docker/distribution/reference has a new home github.com/distribution/reference

and a new tag v0.5.0. Let's switch to that.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 889c8e919bdc8115ad579bb092a4dafdf695754e
2023-08-31 10:48:53 -04:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
Sean Sullivan 6dde41fea6 Removes unnecessary dry run verifier
Kubernetes-commit: 530f65d6fd5af81c0691143fbf2c00d440476bb9
2022-12-05 16:25:12 -08:00
Brian Pursley c6025a8904 kubectl/pkg/cmd/run: deprecate flags
The --cascade flag, has no practical effect when used, so it is being deprecated.

The following flags, which are unused and ignored by kubectl run,
have been deprecated:

--filename
--force
--grace-period
--kustomize
--recursive
--timeout
--wait

Kubernetes-commit: 09804a198c64f0a738ede28e0b2cb045d16980fc
2022-11-03 23:11:12 -04:00
Brian Pursley 96fc22ebfb Revert "Remove unused flags from kubectl run"
Kubernetes-commit: eae2c424efd9dda8cb0f5ba01ab4c955cdf42cfa
2022-09-05 09:34:48 -04:00
Brian Pursley 7a7b2a177c Remove unused flags from kubectl run
The following flags, which do not apply to kubectl run,
have been removed:
--cascade
--filename
--force
--grace-period
--kustomize
--recursive
--timeout
--wait

These flags were being added to the run command to support
pod deletion after attach, but they are not used if set, so
they effectively do nothing.

This PR also displays an error message if the pod fails to be
deleted (when the --rm flag is used).  Previously any error
during deletion would be suppressed and the pod would remain.

This PR also adds some unit tests for run and attach with and
without the --rm flag.  As such, some minor refactoring of the
run command has been done to support mocking dependencies.

Kubernetes-commit: 25e713ba777ec1158fad749e9467601526ba096a
2022-06-21 10:51:30 -04:00
Maciej Szulik 6707e9d96c Improve run and debug attach message upon failure
Kubernetes-commit: 43c2ae479f056f9e420062e11f3251b7095c3108
2022-06-24 09:07:44 +02:00
mozillazg 66c4b40dd6 kubectl: Remove deprecated flags
Remove the deprecated `--serviceaccount`, `--hostport`, `--requests` and `--limits` flags

Kubernetes-commit: 95f5d507f5b5a19d9b031bfa5eb46e72311f9896
2022-03-19 15:32:06 +08:00
Kevin Delgado 7e681490ec Generalize dry run verify to arbitrary query param
Kubernetes-commit: d6c83281bc696474a76365a879f2255b8b568786
2022-03-09 14:51:50 +00:00
brianpursley 07f77100fc Add --override-type flag to kubectl run and kubectl expose to allow the choice of using a JSON Patch or Strategic Merge Patch to apply the override to the generated output.
Kubernetes-commit: 0e697e19ac9f73e2efa0e60157730ba8731e3847
2021-11-05 07:10:47 -04:00
Jérôme Petazzoni eadcbb187a Minor improvements in 'kubectl run' flag help
I initially noticed a minor typo in --tty, and while fixing it,
I noticed small discrepancies in some other flags. These minor
changes should make the 'kubectl run' flag help slightly more
correct (hopefully). 🙂

Kubernetes-commit: 7ca336caf383bca9848cab64657a92b025f34312
2021-10-06 16:57:47 +02:00
Eddie Zaneski 20604e9e21 Remove functionality from deprecated kubectl run flags
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: da8f404ae09823ff5fa214397215263f095e90f2
2021-09-09 15:22:28 -06:00
Andrea Hoffer 09ed00ef49 Minor adjustments to descriptions and example text
Kubernetes-commit: 6b736f348483bb6b20d4633319305960f4d9e4c1
2021-07-06 15:05:26 -04:00
Maciej Szulik 1198e26232 Drop deprecated run flags and deprecate unused ones
Kubernetes-commit: f38ef2fbc6299f4b050a0daa578bfbf393df467c
2021-03-03 22:22:58 +01:00
Julian V. Modesto 04f62ffb0b Cache the OpenAPI schema for server-side dry-run.
Currently, server-side dry-run fetches the OpenAPI schema for every
single object.

This change fetches the OpenAPI schema only once.

Kubernetes-commit: caa158610dfb53de3582ed6df0eb37359206fc66
2021-01-19 16:36:14 -05:00
Douglas Schilling Landgraf b839958e59 kubectl: run - remove unneeded vars
No need extra vars just for a single validation.

Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>

Kubernetes-commit: ea017e53af84b05154f275fabcfc95a61b091493
2021-01-15 21:03:27 -05:00
xiongzhongliang ceb5d08972 add -q as shorthand for --quiet
Kubernetes-commit: a7e15c7606d24f0ff11c5ddf05f3cbc6ab891e16
2020-12-31 19:18:17 +08:00
zhouya0 8411619cbf Support kubectl delete foreground
Kubernetes-commit: 383b5f676670d99dc1fba4254ba7f6a81a052ba3
2020-07-23 18:45:59 +08:00
Sai Harsha Kottapalli abcbb6390c allow adding annotations to pod when using kubectl run and add tests
Kubernetes-commit: 661de7f39eeab6a6977d59f9a24129477f7c5815
2020-07-23 19:37:22 +05:30
zhouya0 2b8a7e264f Remove kubectl run validate replicas logic
Kubernetes-commit: 4b82d5ae084719e5ff5e1d6a5036452eb91f4099
2020-06-16 17:01:33 +08:00
Brian Pursley 683f5c08eb Added --privileged flag to kubectl run
Kubernetes-commit: cd005c1da41e54971319030687cecafec4884868
2020-04-28 16:30:59 -04:00
zhouya0 4a94a16b14 Fix kubectl run ignore namespace
Kubernetes-commit: b3c830d4bf260c68d4299cd1879dbe9ce9913bc6
2020-05-04 22:35:03 +08:00
Davanum Srinivas 445ad1366b switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Julian V. Modesto 415a73888a Set kubectl field manager names
Kubernetes-commit: 360c348d0eb5be8c7c9720d5bfda16dbe04e8d15
2020-03-04 22:04:01 -05:00
Maciej Szulik d727dabb7d waitForPod should use different exitCondition depending on restart policy
Kubernetes-commit: 6f1484256db9579361d218aef7f7960446fd541d
2020-04-24 13:04:42 +02:00
wojtekt 5b27ac0ca2 Fix the flaky kubectl tests at scale
Kubernetes-commit: 98058a1b68da3726e1110dc8bba3838459d03b29
2020-04-23 22:05:55 +02:00
Maru Newby 2cd642e11a kubectl: Update run's --restart help to reflect generator removal
PR #87077 ensured that only pods would created by `kubectl run`. This
change updates the help text for the `--restart` parameter to no longer
reference the removed job and deployment generators.

Kubernetes-commit: ab8b69b54eed552845c0548a30909f97ceaf0457
2020-04-02 21:30:25 -07:00
Maciej Szulik 6a446d6097 Re-use podAttachTimeout when waiting for pod readiness
Kubernetes-commit: c2bb76ebc902ea5172aa56db78d1fb59f4f88bec
2020-04-22 17:01:13 +02:00
Julian V. Modesto b6cbb3bd6c Clean up --dry-run values.
- Clean up --dry-run values in tests, docs, and scripts
- Fix --dry-run for auth reconcile and add a test

Kubernetes-commit: d97169f59ad11f2d2ffd8ef14446bbec5ffc881b
2020-02-13 16:28:22 -05:00
Julian V. Modesto f9460c5333 Use --dry-run=client,server in kubectl.
- Support --dry-run=server for subcommands apply, run, create, annotate,
expose, patch, label, autoscale, apply set-last-applied, drain, rollout undo
- Support --dry-run=server for set subcommands
  - image
  - resources
  - serviceaccount
  - selector
  - env
  - subject
- Support --dry-run=server for create subcommands.
  - clusterrole
  - clusterrolebinding
  - configmap
  - cronjob
  - job
  - deployment
  - namespace
  - poddisruptionbudget
  - priorityclass
  - quota
  - role
  - rolebinding
  - service
  - secret
  - serviceaccount
- Remove GetClientSideDryRun

Kubernetes-commit: 13b80b48cd02b8263d910f2423a1f5b92cdf7644
2020-01-30 20:23:33 -05:00
Mike Danese 71d8052cb0 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Julian V. Modesto c0b11fa131 Extend --dry-run to support string values.
* Extend --dry-run to support string values for dry run strategies
  'client', 'server', and 'none'
* Ensure --dry-run is set and accessed via cmdutil
* Deprecate --dry-run (unset), --dry-run=true, and --dry-run=false

Kubernetes-commit: af52beda260257e81cc9e19e9e5108b682ee93d6
2019-12-15 18:29:27 -05:00
Maciej Szulik c6c7c0dfb8 Remove kubectl run generators
Kubernetes-commit: 82f97775b7c2317a8ca45e616a09e447da987ab2
2020-01-09 17:09:51 +01:00
Julian V. Modesto a3f7877cd1 Support DryRun in cli-runtime REST Helper.
- Move TestSupportsDryRun to cli-runtime
- Move TestDryRunVerifier to cli-runtime
- Add OpenAPI schema for testdata to cli-runtime
- Use Helper.DryRun and DryRunVerifier for Apply
- Add WithOptions methods to Helper

Kubernetes-commit: 6bea0e469bcfe4967cbf2656a998d60e0b684747
2019-12-18 22:00:34 -05:00
hbceylan f0cc26a729 fix kubectl run help image name
Kubernetes-commit: 5b4a7744fad614732de87e032f5d4dba743fddf9
2019-12-23 21:49:37 +00:00
ZP-AlwaysWin b3895b0e0e fix kubectl run --generator=xxx bug
Kubernetes-commit: 860845b58216fa7fa058bacd06b4be5caefa6251
2019-09-15 14:27:33 +08:00
Sean Sullivan 1483769081 Update gofmt
Kubernetes-commit: e2cae2344486af198f8ab38e4dd97d4f24dfd190
2019-08-01 13:14:06 -07:00
Sean Sullivan 5b48717f2d Update import statements to reflect code move
Kubernetes-commit: acece3c2964115a4f29a43e368ad5de59dbbc258
2019-08-01 11:10:05 -07:00
Sean Sullivan c6063dd846 Move pkg/kubectl/cmd/{command} to staging
Kubernetes-commit: 0e0ea523392f1121f61f99ac30a9bc2043eaed90
2019-08-01 11:01:40 -07:00