mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Removes test-cmd inappropriate dependency on kubectl
This commit is contained in:
parent
6fe4119998
commit
e851af0aab
@ -1,7 +1,6 @@
|
|||||||
sh_library(
|
sh_library(
|
||||||
name = "legacy-script",
|
name = "legacy-script",
|
||||||
srcs = glob(["*.sh"]),
|
srcs = glob(["*.sh"]),
|
||||||
data = ["//pkg/kubectl/validation:testdata/v1/validPod.yaml"],
|
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ run_pod_tests() {
|
|||||||
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
|
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
|
||||||
|
|
||||||
## Patch can modify a local object
|
## Patch can modify a local object
|
||||||
kubectl patch --local -f pkg/kubectl/validation/testdata/v1/validPod.yaml --patch='{"spec": {"restartPolicy":"Never"}}' -o yaml | grep -q "Never"
|
kubectl patch --local -f test/fixtures/pkg/kubectl/cmd/patch/validPod.yaml --patch='{"spec": {"restartPolicy":"Never"}}' -o yaml | grep -q "Never"
|
||||||
|
|
||||||
## Patch fails with type restore error and exit code 1
|
## Patch fails with type restore error and exit code 1
|
||||||
output_message=$(! kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"metadata":{"labels":"invalid"}}' 2>&1)
|
output_message=$(! kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"metadata":{"labels":"invalid"}}' 2>&1)
|
||||||
|
16
test/fixtures/pkg/kubectl/cmd/patch/validPod.yaml
vendored
Normal file
16
test/fixtures/pkg/kubectl/cmd/patch/validPod.yaml
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
name: redis-master
|
||||||
|
name: name
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- args:
|
||||||
|
- this
|
||||||
|
- is
|
||||||
|
- an
|
||||||
|
- ok
|
||||||
|
- command
|
||||||
|
image: gcr.io/fake_project/fake_image:fake_tag
|
||||||
|
name: master
|
Loading…
Reference in New Issue
Block a user