* Promote plugin resolution to beta
* Not use plugin for kubectl create -f command execution
`kubectl create -f` is legitimate command execution and we shouldn't
search plugins if user invokes this.
* Add integration test for plugin resolution for create command
* Reintroduce feature flag to ability to disable it explicitly
Kubernetes-commit: 074a8b00840e85cc95fd83b1825b14ab21ad09c4
* Add warning handler callback function in shortcut expander
Currently, errors in client-go are propagated back to the callers via
function returns. However, there is no elegant way for just warning users.
For example, when user wants to get a resource with it's short name format
and if there are multiple resources belonging to this short name, we need to
warn user about this ambugity which one is picked and which ones are discarded.
Not only to overcome this particular case mentioned above, but also propose a
way for the possible warnings in the future, this commit adds a warningHandler
callback function in shortcutExpander.
* Add warningPrinter functionality in ConfigFlags
ConfigFlags has neither warning user in a standardized
format functionality nor passing warning callback functions to other upper level
libraries such as client-go.
This commit adds an ability that user can set warningPrinters
according to their IOStreams and this warningPrinters will be used
to raise possible warnings happening not only in cli-runtime but
also in client-go.
* Pass warning callback function in ConfigFlags to shortcutExpander
This commit passes warning callback function to print possible
warnings happened in shortcut expander to warn user in a
standardized format.
* Add integration test for CRDs having ambiguous short names
This commit adds integration test to assure that warning message
related to this ambiguity is printed when resources are being retrieved via their short name
representations in cases where multiple resources have same
short names.
This integration test also ensures that the logic behind which resource
will be selected hasn't been changed which may cause disperancies in
clusters.
* Remove defaultConfigFlag global variable
* Move default config flags initialization into function
* Skip warning for versions of same group/resource
* Run update-vendor
* Warn only once when there are multiple versions registered for ambiguous resource
* Apply gocritic review
* Add multi-resource multi-version ambiguity unit test
Kubernetes-commit: a504aed54d028dbc8ea2508142c94d309f5f1ec6
The contains-group-resources was an implementation error, we specified
contains-group-kinds in the KEP.
Because it is in alpha, we simply switch to the new annotation.
We will recognize the old annotation and migrate existing alpha
applysets, but support for this migration can be removed in beta/GA of
applyset.
Kubernetes-commit: 10caecb3b22cf93c7caa2ac70d40af9b550c0da2
`f.ToRawKubeConfigLoader().Namespace()` throws `ErrEmptyConfig` when
default configuration file can not be found, even if it invalid.
However, when user explicitly passes `--local` flag, that means
we can gracefully handle this error and continue. This commit does that
for the commands having `--local` flag.
Kubernetes-commit: ba49ccdbc9b4761d0c9589ab7ca9f41029a99568
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
Legacy server support for ephemeral containers were added in kubetl
debug in 1.22. Since now we are in 1.29, we can safely remove ephemeral
container legacy server support because 1.22 is already far away from
supported version skew boundary.
Kubernetes-commit: fdea6ad17d74c7f39e55d4ae2b57f2430c12eaba
Currently, kubectl debug statically relies on handleAttachPod function
in order to attach to the pod.
However, external tools would want to set their own customized attach
function and this commit introduces generic `AttachFunc` function interface
which can also override by external tools.
From the point of kubectl debug, there is no functionality change.
Kubernetes-commit: baed6240468250c855a5ec235e47a64e078bd042
* redo commit
* apply suggestions from liggitt
* update Parse function based on suggestions
Kubernetes-commit: a5b3a4b738e9576b68c3083de8b72002e0b45551
Make it possible to parse jsonpath filter expressions: Split
jsonpath expressions on single '=' only and leave '==' as part of the
string.
Reported-at: https://github.com/kubernetes/kubernetes/issues/119206
Signed-off-by: Andreas Karis <ak.karis@gmail.com>
Kubernetes-commit: 41889984304c44b879d8bcae92c9ed7aa3fd8c67
Since explain openapiv3 has been moved to beta already, there is no
point to having this environment variable.
This PR removes it.
Kubernetes-commit: 4d8f569b037d2979c1d9c5825e5227aadfc8077f
add integration test to wait for json without value
refactor JSON condition value parsing and validating
adjusting test to reflect the error message refactoring
Kubernetes-commit: dbdd861ea366af50fb74983426587dad7222cb89
Extend current JSONPath condition logic to return from wait on "any" value.
Change parsing JSONPath input to support the syntax without value.
Match any simple or complex (object or array) values.
Kubernetes-commit: 9d3e55ec431f3f595a7739fcc592602f7cc1d69b
This PR decouples the command options from the input flags.
The input flags from the command are then translated to
options which are further used while running the command.
Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
Kubernetes-commit: 8f229057484453bd1b820d00c940efbbc56addc5
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Kubernetes-commit: 45836971f27ca70cd7742e8ee66e99e3c648cf9f
- test.args should be passed instead of the os.Args of the test framework
to prevent simple invocation of kubectl without args that could
manifest in false positive test runs
- plugin execution should have a different test path
- tests should invoke functioning kubectl commands instead of the mock
ones to ensure the correct subcommand is executed without a failure
Kubernetes-commit: 8b9cbe62025da49a31518870f2aea0ce9797d3ce
Plugin subcommand resolution is relatively less used than the
builtin subcommands. That's why, instead always initializing a
hash map on memory, it would be better to use a getter function only
serves as needed.
In addition to that this function will be exported that external
libraries can use it.
Kubernetes-commit: 4634073d0b979d2827106a0a1010456ac420baa8
* add no resources found message to rollout-status command
* return err if not nil before no resource message
Kubernetes-commit: a5575425b039bf7c15dfaa9a7acf257fdc4fde3f
T.Setenv ensures that the environment is returned to its prior state
when the test ends. It also panics when called from a parallel test to
prevent racy test interdependencies.
Kubernetes-commit: 2181eea48435310d1b6e366ea8db2968c4941b93