mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 14:11:14 +00:00
kubectl run to produce deployment and job
This commit is contained in:
@@ -611,7 +611,7 @@ runTests() {
|
||||
# Pre-Condition: no RC is running
|
||||
kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
# Command: create the rc "nginx" with image nginx
|
||||
kubectl run nginx --image=nginx --save-config "${kube_flags[@]}"
|
||||
kubectl run nginx --image=nginx --save-config --generator=run/v1 "${kube_flags[@]}"
|
||||
# Post-Condition: rc "nginx" has configuration annotation
|
||||
[[ "$(kubectl get rc nginx -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]]
|
||||
## 5. kubectl expose --save-config should generate configuration annotation
|
||||
@@ -647,6 +647,24 @@ runTests() {
|
||||
# Clean up
|
||||
kubectl delete pods test-pod "${kube_flags[@]}"
|
||||
|
||||
## kubectl run should create deployments or jobs
|
||||
# Pre-Condition: no Job is running
|
||||
kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
# Command
|
||||
kubectl run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(20)'
|
||||
# Post-Condition: Job "pi" is created
|
||||
kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" 'pi:'
|
||||
# Clean up
|
||||
kubectl delete jobs pi
|
||||
# Pre-Condition: no Deployment is running
|
||||
kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
# Command
|
||||
kubectl run nginx --image=nginx --generator=deployment/v1beta1
|
||||
# Post-Condition: Deployment "nginx" is created
|
||||
kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx:'
|
||||
# Clean up
|
||||
kubectl delete deployment nginx
|
||||
|
||||
##############
|
||||
# Namespaces #
|
||||
##############
|
||||
|
Reference in New Issue
Block a user