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
6bd8bbb9
Commit
6bd8bbb9
authored
Feb 23, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4709 from sdminonne/bug_fix2
adding minimal test for label command to hack/test-cmd.sh
parents
8c2e81ef
163ae10d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
test-cmd.sh
hack/test-cmd.sh
+18
-1
No files found.
hack/test-cmd.sh
View file @
6bd8bbb9
...
@@ -151,10 +151,27 @@ for version in "${kube_api_versions[@]}"; do
...
@@ -151,10 +151,27 @@ for version in "${kube_api_versions[@]}"; do
kubectl get pods
"
${
kube_flags
[@]
}
"
-lname
=
redis-master |
grep
-q
'redis-master'
kubectl get pods
"
${
kube_flags
[@]
}
"
-lname
=
redis-master |
grep
-q
'redis-master'
[
!
$(
kubectl delete pods
"
${
kube_flags
[@]
}
"
)
]
[
!
$(
kubectl delete pods
"
${
kube_flags
[@]
}
"
)
]
kubectl get pods
"
${
kube_flags
[@]
}
"
-lname
=
redis-master |
grep
-q
'redis-master'
kubectl get pods
"
${
kube_flags
[@]
}
"
-lname
=
redis-master |
grep
-q
'redis-master'
[
!
$(
delete pods
--all
pods
-l
name
=
redis-master
)
]
# not --all and label selector together
[
!
$(
delete pods
--all
pods
-l
name
=
redis-master
"
${
kube_flags
[@]
}
"
)
]
# not --all and label selector together
kubectl delete
--all
pods
"
${
kube_flags
[@]
}
"
# --all remove all the pods
kubectl delete
--all
pods
"
${
kube_flags
[@]
}
"
# --all remove all the pods
howmanypods
=
"
$(
kubectl get pods
-o
template
-t
"{{ len .items }}"
"
${
kube_flags
[@]
}
"
)
"
howmanypods
=
"
$(
kubectl get pods
-o
template
-t
"{{ len .items }}"
"
${
kube_flags
[@]
}
"
)
"
[
"
$howmanypods
"
-eq
0
]
[
"
$howmanypods
"
-eq
0
]
kubectl create
-f
examples/guestbook/redis-master.json
"
${
kube_flags
[@]
}
"
howmanypods
=
"
$(
kubectl get pods
-o
template
-t
"{{ len .items }}"
"
${
kube_flags
[@]
}
"
)
"
[
"
$howmanypods
"
-eq
1
]
#testing pods and label command command
kubectl label pods redis-master new-name
=
new-redis-master
"
${
kube_flags
[@]
}
"
kubectl delete pods
-lnew-name
=
new-redis-master
"
${
kube_flags
[@]
}
"
howmanypods
=
"
$(
kubectl get pods
-o
template
-t
"{{ len .items }}"
"
${
kube_flags
[@]
}
"
)
"
[
"
$howmanypods
"
-eq
0
]
kubectl create
-f
examples/guestbook/redis-master.json
"
${
kube_flags
[@]
}
"
howmanypods
=
"
$(
kubectl get pods
-o
template
-t
"{{ len .items }}"
"
${
kube_flags
[@]
}
"
)
"
[
"
$howmanypods
"
-eq
1
]
!
$(
kubectl label pods redis-master
name
=
redis-super-sayan
"
${
kube_flags
[@]
}
"
)
kubectl label
--overwrite
pods redis-master
name
=
redis-super-sayan
"
${
kube_flags
[@]
}
"
kubectl delete pods
-lname
=
redis-super-sayan
"
${
kube_flags
[@]
}
"
howmanypods
=
"
$(
kubectl get pods
-lname
=
redis-super-sayan
-o
template
-t
"{{ len .items }}"
"
${
kube_flags
[@]
}
"
)
"
[
"
$howmanypods
"
-eq
0
]
# make calls in another namespace
# make calls in another namespace
kubectl create
--namespace
=
other
-f
examples/guestbook/redis-master.json
"
${
kube_flags
[@]
}
"
kubectl create
--namespace
=
other
-f
examples/guestbook/redis-master.json
"
${
kube_flags
[@]
}
"
...
...
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