Enables the PatchOrReplace call for the cordon helper to accept a
user-supplied context to be used for the client.Patch/Update calls to
alter the node status while cordoning/uncordoning the node.
Signed-off-by: Sagar Muchhal <muchhals@vmware.com>
Kubernetes-commit: 017eaa519de5926fd75a9ddc61bedf2398b69653
It took me a while to spot this subtlety.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Kubernetes-commit: 7c764c8550121b48a6e2678700b6a80fa7d3e2f0
When using GNU diffutils, some commands (e.g. --color[=WHEN])
requires an equal sign.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Kubernetes-commit: 722751accf7607f4d0573778e85027c63e1802ce
No need extra vars just for a single validation.
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Kubernetes-commit: ea017e53af84b05154f275fabcfc95a61b091493
cleanup: change klog.Fatalf to fmt.Errorf for kubectl auth reconcile
cleanup: change klog.Fatalf to fmt.Errorf for
Kubernetes-commit: 3b3a6d27cd1a55fff173427ac9d74d35de7f5acf
fix kubectl label error when local=true is set.
fix kubectl label error when local=true is set.
Kubernetes-commit: cb7009a63bbc90569493f070463ae6715088d46a
Certain missing comments and typos in comments are fixed in the files
that implement `kubectl create` subcommands.
Kubernetes-commit: 1c5c8601e479cc3b32809868c250aeb256796484
Otherwise, the namespace gets set to what's a current namespace
in provided kubeconfig. Which can be different from default.
Kubernetes-commit: d4e89547f065ac5eee67ab4646fb3cee874dc1a9
vendor/k8s.io/kubectl/pkg/cmd/scale/scale.go:212:2: this value of err is never used (SA4006)
Kubernetes-commit: 5710e1b162ea90a3df2622d09864bf2411eb5fd7
When trying to upload an unexisting file to a pod,
kubectl currently doesn't print any error message
and terminates with a zero exit code.
This adds a check and fails explicitly in such cases.
Kubernetes-commit: 3fa5b504423f169723b911547cd22ae85da168e0
cleanup: use i18n.T only on string literals
cleanup: sort imports
Add i18n dependency for wait.go
Remove translation on envResource
cleanup: translate string instead of variable
cleanup: sort imports
cleanup: translate string literal only
Kubernetes-commit: cc8428566ea7160c5b20410a1bee53ca7ddb998e
Currently, if users try to use external diff command with arguments
will fail because the entire command won't be available through $PATH.
This patch allow users to use external diff tools with args (or not)
via KUBECTL_EXTERNAL_DIFF env.
Reference: https://github.com/kubernetes/kubectl/issues/937
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Kubernetes-commit: a6158c01b9add5b580059d24cb66e54c37ea2531
in: staging/src/k8s.io/kubectl/pkg/cmd/create/create_rolebinding_test.go
test: TestCreateRoleBinding
On go version 1.15.3, casting int to string using `string(int)` causes
the test to fail with this error:
>> k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/create
vendor/k8s.io/kubectl/pkg/cmd/create/create_rolebinding_test.go:75:9:
conversion from int to string yields a string of one rune, not a
string of digits (did you mean fmt.Sprint(x)?)
FAIL k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/create
[build failed]
FAIL
make: *** [Makefile:185: test] Error 1
Kubernetes-commit: 1e0bbe61ae4d4e186bc8d0991210d1613dc71996
The option --delete-local-data according with users is not clear.
This patch deprecate --delete-local-data in favor of --delete-emptydir-data.
Reference:
https://github.com/kubernetes/kubernetes/issues/80228
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Kubernetes-commit: 625e47aaa2769d221c59e5b9b05b4ac97212719b
* api: structure change
* api: defaulting, conversion, and validation
* [FIX] validation: auto remove second ip/family when service changes to SingleStack
* [FIX] api: defaulting, conversion, and validation
* api-server: clusterIPs alloc, printers, storage and strategy
* [FIX] clusterIPs default on read
* alloc: auto remove second ip/family when service changes to SingleStack
* api-server: repair loop handling for clusterIPs
* api-server: force kubernetes default service into single stack
* api-server: tie dualstack feature flag with endpoint feature flag
* controller-manager: feature flag, endpoint, and endpointSlice controllers handling multi family service
* [FIX] controller-manager: feature flag, endpoint, and endpointSlicecontrollers handling multi family service
* kube-proxy: feature-flag, utils, proxier, and meta proxier
* [FIX] kubeproxy: call both proxier at the same time
* kubenet: remove forced pod IP sorting
* kubectl: modify describe to include ClusterIPs, IPFamilies, and IPFamilyPolicy
* e2e: fix tests that depends on IPFamily field AND add dual stack tests
* e2e: fix expected error message for ClusterIP immutability
* add integration tests for dualstack
the third phase of dual stack is a very complex change in the API,
basically it introduces Dual Stack services. Main changes are:
- It pluralizes the Service IPFamily field to IPFamilies,
and removes the singular field.
- It introduces a new field IPFamilyPolicyType that can take
3 values to express the "dual-stack(mad)ness" of the cluster:
SingleStack, PreferDualStack and RequireDualStack
- It pluralizes ClusterIP to ClusterIPs.
The goal is to add coverage to the services API operations,
taking into account the 6 different modes a cluster can have:
- single stack: IP4 or IPv6 (as of today)
- dual stack: IPv4 only, IPv6 only, IPv4 - IPv6, IPv6 - IPv4
* [FIX] add integration tests for dualstack
* generated data
* generated files
Co-authored-by: Antonio Ojea <aojea@redhat.com>
Kubernetes-commit: 6675eba3eff1c8e565c4060a9c1396f75da7cc3e
Some unit tests throw this warning.
W1013 09:06:21.581870 176998 helpers.go:567] --dry-run=true is deprecated (boolean value) and can be replaced with --dry-run=client.
This patch removes the warning by using --dry-run=client instead of --dry-run=true.
The unit tests that are affected are:
make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/apply GOFLAGS=-v
make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/create GOFLAGS=-v
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Kubernetes-commit: ad7cbac16354e19981e986bbc2b3fd9cfa930d45
Empty key and non-empty effect means to match all keys and values and
the specified effect. However "kubectl describe" prints it without space
between effect and operator. This patch adds the space for this case.
Kubernetes-commit: 04185f4e533b9b8ebaabe1ed09516e85c5ed1ae1
Add `create ingress` unit tests
Move src code to staging dir
Update create command to reflect new API
Replaced deprecated `extensions` api with `networking`
Fix `missing strict dependencies`
Update BUILD
Update BUILD
Fix commit conflict with upstream
Update after review
* Removed obsolete files
* Moved v1beta to v1 api
Fixed gofmt
Fixed deps imports
Merge with PR #94327
Revert changes
Revert go.mod
Revert BUILD
No need to update generated BUILD
Add required deps to BUILD
Update BUILD
Kubernetes-commit: be45584a03aa9f3a3fd73e3d9cc69545da92616e
Clarify that `REMOTE_PORT` is interpreted as identifying a _Service_ port when provided `TYPE` is `service`.
Also, highlight support for specifying a named port as `REMOTE_PORT`.
Kubernetes-commit: 68e8fd5f33647f22a1bd9ff8508003a969036e25
fixed syntax, wrote a test
fixed a test
.
1
Update staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go
Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk>
added test
.
fix
fix test
fixed a test
gofmt
lint
fix
function name
validation fix
.
godocs added
.
Kubernetes-commit: 316eff8dee1bb7a5929a28bc07bace910bb0e126
- Changed kubectl top to sort first at the pod level and then at the container level when --sort-by and --containers are used together.
- Refactored printSinglePodMetrics into two separate functions instead of passing in bool to change behavior.
- Refactored MetricsSorters to simplify code.
- Added unit tests to test container sorting.
- Fixed pod sorting unit tests which were not working because it was checking for --sort-by command line flag which was never true.
Kubernetes-commit: 04266b37ded103ddb84a192ec816499904fce1d1
If a service has both TCP and UDP but the TCP port appears before in the
range loop, it will be considered a UDP-only port and the forwarding
will fail.
Fix that by calculating the difference between UDP ports and TCP ports.
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Kubernetes-commit: 21b598cbe752dc5d2a2bca0e46729c9e72d162a3
Fix containerNameToRef func to get init containers and ephemeral containers properly.
Set EphemeralContainers in generatePodCopyWithDebugContainer func to nil which means
dropping ephemeral containers from a copy of pod so that it can be created successfully,
otherwise it is rejected by the API server.
Kubernetes-commit: bf3dfaf99942eab20fac1570ca0146d32cb93b57
Currently, there is no way to supply custom pod filters to
exclude pods meeting arbitrary criteria when using drain
as a library.
This commit adds the ability for developers to add custom
filters to the drain operation when utilizing drain
as a library.
This commit exports certain types that were previously
private to allow for better code reuse.
This commit also adds appropriate unit tests.
Kubernetes-commit: 85004f030dc3dceb9d15f41fdd607545758d5da2
The author of this dependency is removing the vanity url and has
instructed users to use the GitHub path.
This updates the dependency to the module-less pin to the v1 module tag.
https://github.com/fvbommel/util/issues/5https://github.com/fvbommel/util/issues/6
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>
Kubernetes-commit: db826b14583be77a1757f7f8aaef864ece627042
If a pod is already marked deleted, and the eviction
api returns an unauthorized response, ignore that
error since the pod is marked for deletion already.
If the pod is not already marked deleted, retry.
Kubernetes-commit: 8d2a2ffe014ed06b5f8971e7f3dc25ec155e44d4
The current structure is limited in the size of the patch it can
accept depending on the shell of the environment (for instance, a
900kb patch cannot be applied in bash 4 on Fedora 32). Allow a user
to specify `--patch-file` to provide a file containing the patch
rather than directly on the command line.
Kubernetes-commit: 6c165083ce4665dbdbc29fbdea03e538e87abaa2
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
This test verifies that adding the "expose" parameter results in a
service being created for the pod.
Kubernetes-commit: c5c48c96804a6dd47cb8fbac25280f3b456f1cae
When called with a node target, `kubectl debug` will create a run-once
pod in the target node's namespaces.
Kubernetes-commit: 7e63cc8b9d592abbb8a659205555e67b57080837
This reuses the code for describing a PVC, except that the output gets
indented more and some fields are skipped.
Kubernetes-commit: c1178bd925b54898e66cace37d35bf551380a75b
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
For the beta server-side dry-run feature, `kubectl apply` provided the
`--server-dry-run` flag.
As of 1.18, this flag was deprecated and marked to be removed after 1
release.
Kubernetes-commit: 3e93f9926279db8a4d064d615c4ad7cfdc7ab38b
- Remove the ServerDryRun field and delegate it entirely to the resource.Helper
- Use resource.Helper for deletions (as in `kubectl apply --force`)
instead of using the pruner's method that uses a dynamic client
- Reduce the resource.Helpers and times we check for server-side dry-run
in apply
Kubernetes-commit: f0eb68c0cfcff6d50d9d5ec278f96820e3cb3f9a
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
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
Before https://github.com/kubernetes/kubernetes/pull/83084, `kubectl
apply --prune` can prune resources in all namespaces specified in
config files. After that PR got merged, only a single namespace is
considered for pruning. It is OK if namespace is explicitly specified
by --namespace option, but what the PR does is use the default
namespace (or from kubeconfig) if not overridden by command line flag.
That breaks the existing usage of `kubectl apply --prune` without
--namespace option. If --namespace is not used, there is no error,
and no one notices this issue unless they actually check that pruning
happens. This issue also prevents resources in multiple namespaces in
config file from being pruned.
kubectl 1.16 does not have this bug. Let's see the difference between
kubectl 1.16 and kubectl 1.17. Suppose the following config file:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: foo
namespace: a
labels:
pl: foo
data:
foo: bar
---
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: bar
namespace: a
labels:
pl: foo
data:
foo: bar
```
Apply it with `kubectl apply -f file`. Then comment out ConfigMap foo
in this file. kubectl 1.16 prunes ConfigMap foo with the following
command:
$ kubectl-1.16 apply -f file -l pl=foo --prune
configmap/bar configured
configmap/foo pruned
But kubectl 1.17 does not prune ConfigMap foo with the same command:
$ kubectl-1.17 apply -f file -l pl=foo --prune
configmap/bar configured
With this patch, kubectl once again can prune the resource as before.
Kubernetes-commit: 7af3b01f24edfde34e42640ee565a5a6bb66ce26
Heapster is retired since 1.11.
Having kubectl top mention Heapster is confusing for users.
Kubernetes-commit: 6d9fbd2d9f2fa77da20ebdf800d129e70ee7b932