mirror of https://github.com/k3s-io/k3s
![]() Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Provide aggregated validation errors for version and kind Currently the validation checks is done individually for version and kind group. For example, if user provided yaml file is missing apiVersion and kind fields, first they will receive error on apiVersion. Once user update the file and try to recreate, an error on missing kind is displayed. The behavior is same for wrong types of the fields. These errors should be aggregated and displayed. Examples of current validation: 1 test.yaml is missing apiVersion and kind: $kubectl.sh create -f /home/sahdev/go/src/bugfixes/test.yaml error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: apiVersion not set; if you choose to ignore these errors, turn validation off with --validate=false 2. test.yaml is fixed for apiVersion but missing kind: $kubectl.sh create -f /home/sahdev/go/src/bugfixes/test.yaml error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: kind not set; if you choose to ignore these errors, turn validation off with --validate=false Examples with aggregated validation: 1. error: error validating "/home/sahdev/go/src/bugfixes/test.yaml": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false 2. error: error validating "/home/sahdev/go/src/bugfixes/testmix.yaml": error validating data: [apiVersion isn't string type, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false **What this PR does / why we need it**: To provide aggregated validations to user for version and kind group. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #54098 **Special notes for your reviewer**: **Release note**: ```release-note NONE ``` |
||
---|---|---|
.. | ||
apply | ||
apps | ||
cmd | ||
explain | ||
metricsutil | ||
plugins | ||
proxy | ||
resource | ||
testing | ||
util | ||
validation | ||
BUILD | ||
OWNERS | ||
apply.go | ||
autoscale.go | ||
autoscale_test.go | ||
bash_comp_utils.go | ||
cluster.go | ||
cluster_test.go | ||
clusterrolebinding.go | ||
clusterrolebinding_test.go | ||
configmap.go | ||
configmap_test.go | ||
delete.go | ||
delete_test.go | ||
deployment.go | ||
deployment_test.go | ||
doc.go | ||
env_file.go | ||
env_file_test.go | ||
generate.go | ||
generate_test.go | ||
history.go | ||
interfaces.go | ||
kubectl.go | ||
namespace.go | ||
namespace_test.go | ||
pdb.go | ||
quota.go | ||
quota_test.go | ||
resource_filter.go | ||
resource_filter_test.go | ||
rolebinding.go | ||
rolebinding_test.go | ||
rollback.go | ||
rolling_updater.go | ||
rolling_updater_test.go | ||
rollout_status.go | ||
rollout_status_test.go | ||
run.go | ||
run_test.go | ||
scale.go | ||
scale_test.go | ||
secret.go | ||
secret_for_docker_registry.go | ||
secret_for_docker_registry_test.go | ||
secret_for_tls.go | ||
secret_for_tls_test.go | ||
secret_test.go | ||
service.go | ||
service_basic.go | ||
service_basic_test.go | ||
service_test.go | ||
serviceaccount.go | ||
serviceaccount_test.go | ||
sorting_printer.go | ||
sorting_printer_test.go | ||
versioned_client.go |