mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Removes test-cmd inappropriate dependency on kubectl
This commit is contained in:
parent
6fe4119998
commit
e851af0aab
@ -1,7 +1,6 @@
|
||||
sh_library(
|
||||
name = "legacy-script",
|
||||
srcs = glob(["*.sh"]),
|
||||
data = ["//pkg/kubectl/validation:testdata/v1/validPod.yaml"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
@ -438,7 +438,7 @@ run_pod_tests() {
|
||||
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
|
||||
|
||||
## 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
|
||||
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