Commit Graph

52 Commits

Author SHA1 Message Date
Jan Chaloupka 81135b09fa kubectl describe pod: use ReportingController as an event source
With https://github.com/kubernetes/kubernetes/pull/91645 merged (promotion of v1beta1 events to v1),
it's no longer permitted to set Source field.
Based on https://stupefied-goodall-e282f7.netlify.app/contributors/design-proposals/instrumentation/events-redesign/#backward-compatibility
Source.Component is supposed to be replaced by ReportingController.
Source.Host is supposed to be replaced by DeprecatedHost, though DeprecatedHost
was never implemented. Thus, ignoring the second field.

Kubernetes-commit: 71edf075de3ea0e26aa40f06f1670862aaebcf33
2020-08-04 18:10:34 +02:00
jingxueli 1cf6fb3a8f add line break when describe hpa
Kubernetes-commit: 1bfd6ed6ec7478038fd3dd9839ac7e7a3bab46fb
2020-06-18 20:40:54 +08:00
Abhishek Raut 05cb9b1f24 Fix NetworkPolicy describe for egress-all policies
NetworkPolicy egress-all `kubectl describe` output should refer
to the term "destination" as opposed to "source" for describing
policies which do not restrict traffic based on the destination.

Kubernetes-commit: e0caf0b46f061c3fafa10aef83592fe300f2bf52
2020-07-15 18:58:25 -07:00
Patrick Ohly 953fac2d9a GenericEphemeralVolume: kubectl describe
This reuses the code for describing a PVC, except that the output gets
indented more and some fields are skipped.

Kubernetes-commit: c1178bd925b54898e66cace37d35bf551380a75b
2020-07-03 12:09:34 +02:00
Christopher M. Luciano c87f320efb ingress: Add v1 describers for Ingress and IngressClass
Ingressv1 Get is attempted for Ingresses and IngressClasses
and falls back to Ingressv1beta1 if there is a failure.

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 31520ccb9b9a96acc4721b69ae231a6cbb74a503
2020-05-19 16:34:34 -04:00
Jordan Liggitt cd341c1697 Add v1 CSR support to kubectl describe
Kubernetes-commit: 92a665e83f223425608e38286fdf147acb85112d
2020-06-04 12:05:51 -04:00
Yashpal Choudhary ee2d0387c2 Fix kubectl describe output format for empty annotations
Kubernetes-commit: 73a43f35f5c44e861eeb03353e372942e7e03761
2020-05-25 14:03:20 +05:30
Jordan Liggitt be12c7c870 Print and describe failed CSRs
Kubernetes-commit: 6b61cb290786688e3f994f4776f3a672c8f30fbb
2020-04-16 01:05:46 -04:00
Oleg Atamanenko 22e383f0f9 Ignore forbidden error for leases when describing node
Kubernetes-commit: 8aa0df4a74e987f8d0f67e71e2327efbdfd04814
2020-04-24 12:59:41 -07: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
Jan Chaloupka 50e4974848 kubectl describe: print toleration tolerating everything
An empty key with operator Exists matches all keys, values
and effects which means this will tolerate everything:
tolerations:
- operator: "Exists"

as stated in https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/.

However, the current printTolerationsMultilineWithIndent implementation ignores
this case. As the toleration is valid, there's no reason
to skip it when writing the list of all pod's tolerations.

Kubernetes-commit: 0bd9a4c6c5ba4fbbc8439effddc99004ddd6b232
2020-05-12 15:59:52 +02:00
gosoon d47103fdcc kubectl: fix the Scheduled eventTime is <unknown> when use kubectl describe pod xxx
Kubernetes-commit: 798f677aaca0b28f22c09ba6b536c84bec6f5d2f
2020-04-17 19:58:27 +08:00
zhouya0 9e97ec383e Fix kubectl describe job event test nil pointer
Kubernetes-commit: a576a3c7070c9aeb1da1878e0ca956190979f03a
2020-03-27 19:07:18 +08:00
zhouya0 ff83e52b28 Add kubectl describe CSINode test coverage
Kubernetes-commit: 991547edb6bc5d9302034fbb94b97204ea951348
2020-03-31 12:15:20 +08:00
zhouya0 6bc21dccc3 Fix kubectl describe CSINode nil pointer error
Kubernetes-commit: 55c455e61f6f1e52337e04eeb4ebd41668ffef17
2020-03-30 17:10:40 +08:00
Jordan Liggitt 0c62c9a83a client-go dynamic client: add context to callers
Kubernetes-commit: b7c2faf26c2a25427794478c6265e6d55e8acb5a
2020-03-06 10:17:41 -05:00
zhouya0 3422a4e85e Show kubectl describe ingress error
Kubernetes-commit: 773b890b059ffe9956c8de4b7f0214b802888390
2020-03-02 16:08:17 +08:00
Maciej Szulik e034e09126 Squash pkg/describe/versioned/ into pkg/describe/
Kubernetes-commit: 02cd65d7bb5e4aea84a4f466186bcbbe604c4b27
2020-03-03 13:06:26 +01:00
Maciej Szulik f2e2579863 Hide kubectl.kubernetes.io/last-applied-configuration in describe
Kubernetes-commit: c77b297babc6b21b71f2a449c4cce95af9f6b89e
2020-03-03 12:54:00 +01:00
Rob Scott 9212fa917c Adding IngressClass to networking/v1beta1
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 132d2afca0794b4bcaedb6dbbefe4e9d66e80239
2020-02-24 21:20:45 -08:00
James Munnelly 15819eb467 Add signerName field to CSR resource spec
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>

Kubernetes-commit: a983356caa9876079eafc5e8dd7806473022e958
2019-12-18 02:19:06 +00:00
zhouya0 de11036690 Fix kubectl describe ingress annotations not sorted
Kubernetes-commit: 0acaf5c3e93cc3422aca47eeea96e9ef553ac35c
2020-02-21 11:02:40 +08:00
Odin Ugedal 6db3ac62f1 Add util function to merge resource lists
Kubernetes-commit: 51bff87b18d6482f7383fb2151c7e483a1641ca7
2019-12-14 20:33:35 +01:00
Odin Ugedal 8f16a43328 Add "kubectl describe node" resource tests
Kubernetes-commit: 28f8e52f320595fd434a2699850e57bc297474a4
2019-12-14 13:24:18 +01:00
Odin Ugedal d62698570f Add huge page usage stats to kubectl describe node
Kubernetes-commit: 439a862bba60f05fb21338bfa02e547428c6ce0c
2019-07-25 22:14:35 +02:00
gavinfish 275513cb52 Staticcheck: vendor/k8s.io/kubectl/pkg/scale|describe/versioned|cmd/top|cmd/util/editor|cmd/top
Kubernetes-commit: f4940cf55fd7c2787b370464d491a764c4febd78
2020-01-21 10:13:10 +08:00
Mike Danese 71d8052cb0 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Philipp Stehle 78fe2274ad Fix describe of statefulset prints pointer not value
Kubernetes-commit: 772dbbc7d78c909fa68fc5218886a2b517c94ca2
2019-12-03 14:33:31 +01:00
Christian Huffman f9e7f47c2e Included CSINode describer
Kubernetes-commit: 1b63219c5eccdbef1d19c1c4dab40f2b46672dbd
2019-11-14 08:27:42 -05:00
Arjun Naik fa550e796d Adds tests
Signed-off-by: Arjun Naik <arjun@arjunnaik.in>

Kubernetes-commit: 8ab226263a18fa16afdb6fd14da63544095a8937
2019-12-10 18:09:08 +01:00
Ivan Glushkov 3af9a45dfd Adds the algorithm implementation for the Configurable HPA
Kubernetes-commit: 27ffe439b61aaee196190749f1191d9957c86ca1
2019-10-14 19:33:09 +04:00
Nan Yu 656f993514 Rename PodDisruptionsAllowed to DisruptionsAllowed in type PodDisruptionBudgetStatus
Kubernetes-commit: 1fb0dd4ec5134014e466509163152112626d52c3
2019-12-03 11:22:23 -08:00
Christian Huffman fc490f462d Included FSType in CSI volumes
Kubernetes-commit: bbae978d4a0885a6135afb713e252ec4fa41a277
2019-11-14 11:18:40 -05:00
Rob Scott 56eaaf1668 Promoting EndpointSlices to beta
Kubernetes-commit: a7e589a8c689d1a6c0c21d47c5e6c97267822875
2019-10-25 14:59:10 -07:00
Rob Scott 4118a67aeb Splitting IP address type into IPv4 and IPv6 for EndpointSlices
Kubernetes-commit: 0fa9981e0106d7f0d6f9c88fc49d4cdf779c95c1
2019-11-06 22:46:04 -08:00
Jack Kleeman 1f00e044fd Fix incorrect message on describe netpol
When I describe network policies, it often tells me that pods are
isolated for egress connectivity because the policy that applies to them
has no egress rules. However, this would only lead to isolation if there
is an explicitly set egress policy type. Otherwise, the policy allows
egress traffic. The same applies if you have explicitly set an egress
type only, describe will incorrectly report isolated ingress traffic.

This PR fixes this by inferring the applicable direction for the policy
based on the PolicyTypes, and then if a policy doesn't apply eg to
egress, we print 'Not affecting egress traffic'

Kubernetes-commit: 7753bfa3a418d95795420d03193732e024456466
2019-10-22 17:43:03 +01:00
ritho b0cd1c2290 Do some Kubectl optimizations suggested by the golangci linter
The tool golangci-lint gives a bunch of warnings. This PR solves the easier/less controversial ones, so the code is simpler and a little bit more optimal, since it removes some if conditions.

Kubernetes-commit: cd2adbe760641f844d84d411f9adcf17fb6982ff
2019-06-04 01:25:43 -05:00
Mike Danese fc0d402286 support URI SANs in local signer
Kubernetes-commit: 6a004d0c18818f79d7c294091f071706aac2d912
2019-11-04 08:08:59 -08:00
Jan Chaloupka 6fd1ff2fb0 Require exact match when calling Get method within fake clientset
`Get` method within the fake clientset returns an object that would not be normally returned when using the real clientset. Reproducer:

```go
package main

import (
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes/fake"
)

func main () {
	cm := &v1.ConfigMap{
		ObjectMeta: metav1.ObjectMeta{Namespace: metav1.NamespaceSystem, Name: "cm"},
		}

	client := fake.NewSimpleClientset(cm)
	obj, err := client.CoreV1().ConfigMaps("").Get("", metav1.GetOptions{})
	if err != nil {
		panic(err)
	}
	fmt.Printf("obj: %#v\n", obj)
}
```

stored under `test.go` of `github.com/kubernetes/kubernetes` (master HEAD) root directory and ran:

```sh
$ go run test.go
obj: &v1.ConfigMap{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"cm", GenerateName:"", Namespace:"kube-system", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, Data:map[string]string(nil), BinaryData:map[string][]uint8(nil)}
```

As you can see fake clientset with a "test" configmap is created. When getting the object through the clientset back, I intentionally set the object name to an empty string. I would expect to get an error saying config map "" was not found. However, I get "test" configmap instead.

Reason for that is inside implementation of `filterByNamespaceAndName` private function:
```go
func filterByNamespaceAndName(objs []runtime.Object, ns, name string) ([]runtime.Object, error) {
	var res []runtime.Object

	for _, obj := range objs {
		acc, err := meta.Accessor(obj)
		if err != nil {
			return nil, err
		}
		if ns != "" && acc.GetNamespace() != ns {
			continue
		}
		if name != "" && acc.GetName() != name {
			continue
		}
		res = append(res, obj)
	}

	return res, nil
}
```

When `name` is empty, `name != "" && acc.GetName() != name` condition is false and thus `obj` is consider as a fit.

[1] https://github.com/kubernetes/client-go/blob/master/testing/fixture.go#L481-L493

Kubernetes-commit: d32c76fc03381784516c47cb1bf62ef932189afa
2019-09-17 17:52:28 +02:00
wojtekt e55208d067 Add information from Lease to kubectl describe node
Kubernetes-commit: b44f8948a4ec4105ce3e989132199dd6757c65e4
2019-10-14 12:53:38 +02:00
Ted Yu 91465db998 Improve 'No resource limits' message
Kubernetes-commit: 3553de332e9367a9126937c5840da00f8001f2a0
2019-10-10 14:31:17 -07:00
caiweidong 521a90f087 add apigroup to the data source when using kubectl describe pvc
Kubernetes-commit: 9157df47e8db6e10edcd398294e6a4c04b3572e9
2019-09-08 15:03:26 +08:00
Sally O'Malley 9555357d5c fix indentation with 'kubectl describe node'
Kubernetes-commit: 4ce16254f7b89324dcbb43de70d0d95cb9ce5865
2019-09-06 16:57:42 -04:00
Rob Scott 743417d981 Adding kubectl support for EndpointSlice
Kubernetes-commit: ab1943e00bff372c362ba1a04353cb000c07d0ea
2019-08-20 14:44:08 -07:00
Matthias Bertschy dfd6b3033e startupProbe: API changes
Kubernetes-commit: e4d26f845e1e11ec75ce3a395ff0fc691347f3cf
2019-08-07 10:21:48 +02:00
Khaled Henidak(Kal) 2ba69fae1d phase 2: api types + defaulting + validation + disabled fields handling
Kubernetes-commit: 5e8ccda71cc676e070cd0f5d7b6990b8ebc24c1f
2019-08-23 17:25:59 +00:00
Lee Verberne 6246fac472 Print ephemeral containers in kubectl describe
Kubernetes-commit: a25ad6d36f4a2e72cd35df2ca27c323a3e99b77e
2019-08-01 05:31:56 +00:00
Tim Allclair f6a4bcd4ac Delete duplicate resource.Quantity.Copy()
Kubernetes-commit: 49f50484b898f55c1db1e25b2a9c2bb76fb45a5d
2019-08-19 17:23:14 -07:00
zouyee 90d15aea78 convert EndpointNamespace showing string rather than pointer
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>

Kubernetes-commit: 96928b9f8b6df751815fe49007cfc73272cc1cdb
2019-08-18 11:37:26 +08:00
j-griffith 5a1a4bbf82 Add DataSource to PVC describe
Kubernetes-commit: 5cc2ea777efaa72dce83ea8c79f73846d1924bfa
2019-04-11 14:14:00 -06:00