Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
89df5490
Commit
89df5490
authored
May 23, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pre-condition before editing pod in test-cmd.sh
parent
4215fe57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
test-cmd.sh
hack/test-cmd.sh
+6
-2
No files found.
hack/test-cmd.sh
View file @
89df5490
...
...
@@ -705,16 +705,20 @@ __EOF__
__EOF__
# Post-condition: the node command succeeds
kube::test::get_object_assert
"node node-
${
version
}
-test"
"{{.metadata.annotations.a}}"
'b'
kubectl delete node node-
${
version
}
-test
kubectl delete node node-
${
version
}
-test
"
${
kube_flags
[@]
}
"
## kubectl edit can update the image field of a POD. tmp-editor.sh is a fake editor
echo
-e
'#!/bin/bash\nsed -i "s/nginx/gcr.io\/google_containers\/serve_hostname/g" $1'
>
/tmp/tmp-editor.sh
chmod
+x /tmp/tmp-editor.sh
EDITOR
=
/tmp/tmp-editor.sh
${
KUBE_OUTPUT_HOSTBIN
}
/kubectl edit
"
${
kube_flags
[@]
}
"
pods/valid-pod
# Pre-condition: valid-pod POD has image nginx
kube::test::get_object_assert pods
"{{range.items}}{{
$image_field
}}:{{end}}"
'nginx:'
EDITOR
=
/tmp/tmp-editor.sh kubectl edit
"
${
kube_flags
[@]
}
"
pods/valid-pod
# Post-condition: valid-pod POD has image gcr.io/google_containers/serve_hostname
kube::test::get_object_assert pods
"{{range.items}}{{
$image_field
}}:{{end}}"
'gcr.io/google_containers/serve_hostname:'
# cleaning
rm
/tmp/tmp-editor.sh
## kubectl edit should work on Windows
[
"
$(
EDITOR
=
cat
kubectl edit pod/valid-pod 2>&1 |
grep
'Edit cancelled'
)
"
]
[
"
$(
EDITOR
=
cat
kubectl edit pod/valid-pod |
grep
'name: valid-pod'
)
"
]
[
"
$(
EDITOR
=
cat
kubectl edit
--windows-line-endings
pod/valid-pod | file - |
grep
CRLF
)
"
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment