Commit Graph

14470 Commits

Author SHA1 Message Date
Jonathan Dobson
082cb15648 Move CSIVolumeFSGroupPolicy feature to GA 2021-11-02 15:22:33 -06:00
Bryan Boreham
a988182f59 'kubectl events' command (#99557)
* Basic scaffolding for kubectl events command

* Simple implementation of 'kubectl events'

* Print event fields

Borrowing code from 'kubectl describe'

* Sort events before printing

* Make output more like 'kubectl get events'

Print namespace if fetching from all

* Refactor: extract print functions

To make it easier to add watch function next.

* Implement watch for new events

Run the list function same as before, so those events come out in order,
then watch from the ResourceVersion after the last event.

* Clear up some lint warnings

* Update description and example text

* refactor: introduce a listOptions variable

* Implement --for option

splitResourceTypeName() function borrowed from cli-runtime because we
need similar behaviour to Builder.ResourceNames(), but applying to
Event.InvolvedObject.

* Add kubectl/pkg/cmd/events to vendor/modules.txt

* Add back cmdutil.Factory

Needed in NewCmdAlpha to construct the 'events' command

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Fix lint

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Make package alias go-cromulent

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use genericclioptions.RESTClientGetter instead of cmdutil.Factory

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Decode object parameter to GroupVersionKind and name

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Merge two files into one

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Include example for --for option

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Fix inconsistent option name in error message

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Remove unnecessary Validate call

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use fields from event series

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Support chunking of list of events

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use watchtools utility to receive watch events

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Split struct into flags and options

Flags represents the inputs from the CLI; options are what the running
command needs. This structure parallels the 'wait' command, and should
be easier to write tests for.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Add some parameters to usage string

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Do only one of list or watch

We tried to print the list first then start a watch after the last
event, but sometimes the server will return "watch is too old" on that
ResourceVersion.
Instead, if we need to watch just start it from the beginning.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Print message if no events found

Also, if watching, don't print the headings until the first event
arrives.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2021-10-29 09:12:50 -07:00
Kubernetes Prow Robot
e580aa93d1 Merge pull request #105739 from tkashem/apf-decision-cancel
apf: call metrics.AddReject for decisionCancel
2021-10-29 08:10:51 -07:00
Kubernetes Prow Robot
59e6e3f2f3 Merge pull request #106010 from wojtek-t/cleanup_watchcache
Minor watchcache cleanup
2021-10-29 06:14:50 -07:00
Abu Kashem
f6dcf17a10 apf: call metrics.AddReject for decisionCancel 2021-10-29 09:11:23 -04:00
Wojciech Tyczyński
ace5554257 Minor watchcache cleanup 2021-10-29 14:09:53 +02:00
Madhav Jivrajani
aab7cd3d8a cacher: refactor process() function
Split process() function into processEvents() and process().
This is done in anticipation of GetAllEventsSinceThreadUnsafe()
returning an entity using which events can be constructed and
not the events itself.

Subsequently, this commit also moves updating resource version
for initEvents from Watch() to the processEvents() func.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2021-10-29 15:34:16 +05:30
Kubernetes Prow Robot
bb24c265ce Merge pull request #104693 from ravisantoshgudimetla/add-podOS-field
Add pod os field
2021-10-28 21:38:50 -07:00
Kubernetes Prow Robot
a8cf023abc Merge pull request #100318 from lyft/hpa-v2beta2-opt-conditions
Mark v2beta1 and v2beta2 HPA status conditions as optional
2021-10-28 20:30:51 -07:00
Kubernetes Prow Robot
c592bd40f2 Merge pull request #105609 from pohly/generic-ephemeral-volume-ga
generic ephemeral volume GA
2021-10-28 17:36:50 -07:00
Zeleena Kearney
65819f66c9 Mark v2beta1 and v2beta2 HPA status conditions as optional to resolve unnecessary apply error 2021-10-28 17:37:19 -05:00
ravisantoshgudimetla
8a6533089a testdata: Pod OS field 2021-10-28 17:33:51 -04:00
ravisantoshgudimetla
41f8f95fc5 generated: Add os field to Pod Spec 2021-10-28 17:31:52 -04:00
ravisantoshgudimetla
3b936d310c api: Introduce os field to pod spec 2021-10-28 17:31:52 -04:00
Kubernetes Prow Robot
1d9d530ee1 Merge pull request #105959 from liggitt/podsecurity-details
PodSecurity: return namespace validation errors in standard field.ErrorList format
2021-10-28 11:51:07 -07:00
Kubernetes Prow Robot
589d47e70c Merge pull request #103908 from wzshiming/fix/kubelet-config-typo
Fix typo in kubelet config
2021-10-28 11:50:59 -07:00
Kubernetes Prow Robot
eb5b5e7f0b Merge pull request #105726 from DiptoChakrabarty/podexecdoc
Fix Documentation of Default params for PodExecOptions Function
2021-10-28 09:20:39 -07:00
Kubernetes Prow Robot
6edcb60d9f Merge pull request #104915 from alculquicondor/job-ready
Track ready pods in Job status
2021-10-28 09:20:26 -07:00
Kubernetes Prow Robot
afff019fbc Merge pull request #105734 from marseel/fix/race_condition
Fix race condition in logging when request times out
2021-10-28 03:14:26 -07:00
Jordan Liggitt
3aa656b63f PodSecurity: return field errors for invalid namespace labels 2021-10-28 00:28:27 -04:00
Jordan Liggitt
c0f33ddf08 PodSecurity: fix level/version validation fieldpaths 2021-10-28 00:28:26 -04:00
Jordan Liggitt
7cd905e897 PodSecurity: plumb kind in attributes 2021-10-28 00:28:26 -04:00
Jordan Liggitt
091724a6d8 apierrors: optimize ToAggregate() for zero-length lists 2021-10-28 00:24:14 -04:00
Jordan Liggitt
57fdd167e4 apierrors: Avoid spurious <nil> in invalid error message 2021-10-27 23:45:06 -04:00
Kubernetes Prow Robot
8fd95902da Merge pull request #105922 from liggitt/podsecurity-warnings
PodSecurity: clean up namespace validation messages, time bounding, and add testing
2021-10-27 16:25:02 -07:00
Kubernetes Prow Robot
3fb98823c4 Merge pull request #105736 from deejross/drain-output-ffix
kubectl drain node output should say node was drained not evicted
2021-10-27 14:19:11 -07:00
Kubernetes Prow Robot
b8ce285a03 Merge pull request #105923 from liggitt/feature/podsecurity-webhook
PodSecurity webhook makefile, image, and manifests
2021-10-27 11:58:24 -07:00
Jordan Liggitt
09e9ba99ab PodSecurity: add resource quota for clusters that limit cluster-critical by default 2021-10-27 13:54:19 -04:00
Jordan Liggitt
a356c32797 PodSecurity: simplify pki setup 2021-10-27 13:54:19 -04:00
Jordan Liggitt
0be8280faa PodSecurity: Set version build flags in makefile
Change-Id: I719e7ce1efce9014e24903f0ad203a52a207f892
2021-10-27 13:54:19 -04:00
Samuel Roth
2a4701c2ca PodSecurity webhook image 2021-10-27 13:54:19 -04:00
Jordan Liggitt
7c5a78bb91 PodSecurity: clean up namespace validation messages, time bounding, and add testing 2021-10-27 13:49:04 -04:00
Kubernetes Prow Robot
aa7c6338c6 Merge pull request #105711 from VilledeMontreal/feat/multiComp
Shell completion of multiple resource names
2021-10-27 10:33:25 -07:00
Kubernetes Prow Robot
011aef1222 Merge pull request #105851 from VilledeMontreal/feature/compOutputFlag
Add completion to the --output/-o flag
2021-10-26 19:10:37 -07:00
Marc Khouzam
7aa5cb4031 Complete multiple resource names
This commit teaches the completion function to repeat resource names
when supported by the command. The logic checks if a resource name
has already been specified by the user and does not include it again
when repeating the completion.

For example, the get command can receive multiple pods names, therefore
with this commit we have:
  kubectl get pod pod1 [tab]
will provide completion of pod names again, but not show 'pod1' since
it is already part of the command-line.

The improvement affects the following commands:
- annotate
- apply edit-last-applied
- apply view-last-applied
- autoscale
- delete
- describe
- edit
- expose
- get
- label
- patch
- rollout history
- rollout pause
- rollout restart
- rollout resume
- rollout undo
- scale
- taint

Note that "rollout status" only accepts a single resource name, unlike
the other "rollout ..." commands; this required the creation of a
special completion function that did not repeat just for that case.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2021-10-26 21:50:11 -04:00
Kubernetes Prow Robot
18cb34ebb2 Merge pull request #105896 from zqzten/upgrade-json-patch
upgrade json-patch to v4.12.0
2021-10-26 15:27:09 -07:00
Kubernetes Prow Robot
7c53095218 Merge pull request #104748 from p0lyn0mial/not-found-handler
return 503 for aggregated APIs when the APIServiceRegistrationController hasn't finished installing all known APIServices
2021-10-26 14:25:09 -07:00
Kubernetes Prow Robot
99ad414127 Merge pull request #104832 from zc2638/fix/kubectl-env-update
add unit tests for `updateEnv`
2021-10-26 13:21:10 -07:00
Jordan Liggitt
c65a0793cd [PodSecurity] Aggregate identical warnings for multiple pods in a namespace (#105889)
* [PodSecurity] Aggregate identical warnings for multiple pods in a namespace

* Make warning order deterministic, limit accumulated pod name data

Co-authored-by: njuptlzf <li.zhifeng@zte.com.cn>
2021-10-26 11:43:09 -07:00
Kubernetes Prow Robot
dba9975e3e Merge pull request #105857 from liggitt/runAsNonRoot-runAsUser
PodSecurity: Add runAsUser check to restricted policy
2021-10-26 00:15:30 -07:00
Zach Zhu
20cc72344e upgrade github.com/evanphx/json-patch to v4.12.0
Fix partial negative indice support in json patch
2021-10-26 11:20:45 +08:00
Kubernetes Prow Robot
e1f62e406d Merge pull request #105719 from yuanhh/master
sample-controller/docs: Use italics font on package name
2021-10-25 20:03:29 -07:00
Kubernetes Prow Robot
87d8a75b0e Merge pull request #105749 from tallclair/pod-security-cli
Add --version flag to podsecurity-webhook command
2021-10-25 13:34:25 -07:00
Jordan Liggitt
40635ca59e PodSecurity: runAsUser: generated fixtures 2021-10-25 16:17:10 -04:00
Jordan Liggitt
a476a5e00e PodSecurity: runAsUser 2021-10-25 16:17:10 -04:00
Jordan Liggitt
9b930e3728 PodSecurity: test: generate 1.23 fixtures 2021-10-25 16:17:10 -04:00
Jordan Liggitt
ef3bf86f5b PodSecurity: test: ensure fixtures are exercised for all relevant policy versions 2021-10-25 16:16:31 -04:00
Kubernetes Prow Robot
a6ffd29e5f Merge pull request #105314 from calvin0327/issue-podsecurity-errormessage
[PodSecurity]Add context to failure message
2021-10-25 11:25:02 -07:00
Tim Allclair
c7cdf19cbe Add --version flag to podsecurity-webhook command 2021-10-25 10:26:05 -07:00
Kubernetes Prow Robot
6166203f45 Merge pull request #105828 from ahg-g/ahg-legacy
Remove scheduler's legacy policy config
2021-10-25 09:38:23 -07:00