Check if delegate is nil before calling Next() in terminalSizeQueueAdapter
to prevent a nil pointer dereference.
Kubernetes-commit: 72a5892dca945f000a30c7a763aa0696964b7e50
Remove reference to internal types in kuberc types
* Remove unserialized types from public APIs
Also remove defaulting
* Don't do conversion gen for plugin policy types
Because the plugin policy types are explicitly allowed to be empty, they
should not affect conversion. The autogenerated conversion functions for
the `Preference` type will leave those fields empty.
* Remove defaulting tests
Comments and simplifications (h/t jordan liggitt)
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Kubernetes-commit: fab280950dabfefabe6a8578b7a76372a9b21874
The --chunk-size flag has been around since October 2017
(i4780ad0297)
so it's about time we make it official.
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
Kubernetes-commit: cf099f4fc9028c60e62de33223492d1ef4e03585
LogOptions.RunLogs unfortunately registers a signal handler and calls
os.Exit(1) after finished processing when a signal is received. This
makes it basically impossible to call that function from any custom
code.
This patch adds RunLogsContext, which does exactly what RunLogs does,
but the context to be used is passed in. RunLogs retains the current
contract, but it uses RunLogsContext internally, then calls os.Exit(1)
when a signal is received.
Kubernetes-commit: cc4666cc94be41d8b4558122717a2da9fb5a7b1a
There is a custom error message returned from resource.Builder when
SingleResourceType is set and multiple resources types are specified,
which makes it impossible to check for the condition in code easily.
This patch adds resource.ErrMultipleResourceTypes that is returned
precisely in this case so that it can be checked.
This patch also removes an extra custom error message in kubectl get,
which is actually never reached, because the builder fails before.
Kubernetes-commit: 82896feebbdf1c0809c0fec29988eff15cb02837
The current help text wordings incorrectly suggests inference only works for RC/RS when it actually works for Pods and Deployments too
Update help text to accurately reflect that selector inference works
for any resource being exposed, as documented in main expose help.
Kubernetes-commit: 5c8f26f48032899031760e5b75ad259d23d312b2
* fix using stale pod when evict failed and retry
* simplify pod refresh process
* use activePod at getPodFn
* fix lint check
* add ut
* introduce EvictErrorRetryDelay
Kubernetes-commit: 66fdbe105831e08b588dd01039a7e3130fd2d36f
This allows consumers of term to not pull in dependencies on
github.com/gorilla/websocket and github.com/moby/spdystream.
Kubernetes-commit: 640dabd58b04b72f646ed85947cb8b407b36dc08
KYAML is a strict subset of YAML, which is sort of halfway between YAML
and JSON. It has the following properties:
* Does not depend on whitespace (easier to text-patch and template).
* Always quotes value strings (no ambiguity aroud things like "no").
* Allows quoted keys, but does not require them, and only quotes them if
they are not obviously safe (e.g. "no" would always be quoted).
* Always uses {} for structs and maps (no more obscure errors about
mapping values).
* Always uses [] for lists (no more trying to figure out if a dash
changes the meaning).
* When printing, it includes a header which makes it clear this is YAML
and not ill-formed JSON.
* Allows trailing commas
* Allows comments,
* Tries to economize on vertical space by "cuddling" some kinds of
brackets together.
* Retains comments.
Examples:
A struct:
```yaml
metadata: {
creationTimestamp: "2024-12-11T00:10:11Z",
labels: {
app: "hostnames",
},
name: "hostnames",
namespace: "default",
resourceVersion: "15231643",
uid: "f64dbcba-9c58-40b0-bbe7-70495efb5202",
}
```
A list of primitves:
```yaml
ipFamilies: [
"IPv4",
"IPv6",
]
```
A list of structs:
```yaml
ports: [{
port: 80,
protocol: "TCP",
targetPort: 80,
}, {
port: 443,
protocol: "TCP",
targetPort: 443,
}]
```
A multi-document stream:
```yaml
---
{
foo: "bar",
}
---
{
qux: "zrb",
}
```
Kubernetes-commit: 2cb955d8ccae30167b9610bfe51c2f86e83a1958
* client-go: Replace depracted ErrWaitTimeout with recommended method
* Fix UT and Integration tests
* IT test
Kubernetes-commit: ffe306d67958297202e9492ea644b42c0e7e694d
* Add JSON & YAML output support for kubectl api-resources
Create a separate `PrintFlags` struct within the apiresources.go file
that handles printing only for `kubetl api-resources` because existing
output formats, i.e., wide and name, are already implemented
independently from HumanReadableFlags and NamePrintFlags.
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Use separate printer type for all options
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Unit tests for JSON & YAML outputs
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Separate file for print types
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Move JSON-YAML tests to separate function
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Fix broken unit test
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Unifying JSON & YAML unit test functions
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* Fix linter errors
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
* PR feedback and linter again
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
---------
Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Kubernetes-commit: cb33accc8fc4d44e902da4926eee7b828c5e51ec
The underlying implementation decodes OpenAPI schema on every HasSupport
call. This causes these calls to be expensive and noticable when many
resources are being applied.
This patch wraps the verifier with a thread-safe cache so that when many
resources of the same kind are being checked, only the first call
includes schema decoding.
This solution is specifically limited to the kubectl codebase without
any changes required in client-go, for now, although that is where the
issue is actually originating.
Kubernetes-commit: 9043afae6d98585dd14d203d48807b14b433d730
The package is unmaintained, and kubectl doesn't rely on the
functionality it provides on top of Golang errors (stack traces).
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Kubernetes-commit: 54b2fad0330032ae1bbac990f93a3644aa8a12af