-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor e2e struct * Revert "refactor e2e struct" This reverts commit 9271224. * simplify lifecycle test wrapper * add expected status over lifetime * add new taint and label for test minikube * add nodeselector and toleration to status * use expected status from lifetime status input * test with different taints and labels * write a little loop to check tolerations * update helper script and makefile with new tolerations * use nodeselector template * merge template and given * add gvisor test * run copied test * rename tests * naming * propogate nodeselector and tolerations to the helm chart * update status update for nodeselector and tolerations * ensure test namespaces are deleted
- Loading branch information
1 parent
f040eab
commit 737d8e6
Showing
15 changed files
with
320 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
spec: | ||
tolerations: | ||
- key: "testkey" | ||
- key: "sandbox.gke.io/runtime" | ||
operator: "Equal" | ||
value: "testvalue" | ||
value: "gvisor" | ||
effect: "NoSchedule" | ||
nodeSelector: | ||
testkey: "testvalue" | ||
sandbox.gke.io/runtime: "gvisor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
spec: | ||
template: | ||
spec: | ||
nodeSelector: | ||
testkey: "testvalue" | ||
tolerations: | ||
- key: "testkey" | ||
- key: "sandbox.gke.io/runtime" | ||
operator: "Equal" | ||
value: "testvalue" | ||
value: "gvisor" | ||
effect: "NoSchedule" | ||
nodeSelector: | ||
sandbox.gke.io/runtime: "gvisor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
kubectl get pods --all-namespaces -o jsonpath="{range .items[*]}{.metadata.namespace}{' '}{.metadata.name}{'\n'}{end}" | while read -r line; do | ||
namespace=$(echo "$line" | cut -d' ' -f1) | ||
pod=$(echo "$line" | cut -d' ' -f2) | ||
kubectl patch pod "$pod" -n "$namespace" --type='json' -p='[{"op": "add", "path": "/spec/tolerations", "value": [{"key": "testkey", "operator": "Equal", "value": "testvalue", "effect": "NoSchedule"}]}]' | ||
kubectl patch pod "$pod" -n "$namespace" --type='json' -p='[{"op": "add", "path": "/spec/tolerations", "value": [{"key": "sandbox.gke.io/runtime", "operator": "Equal", "value": "gvisor", "effect": "NoSchedule"}]}]' || true | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package vcluster | ||
|
||
import v1 "k8s.io/api/core/v1" | ||
|
||
type Toleration v1.Toleration | ||
type NodeSelector map[string]string | ||
|
||
func (t Toleration) Notation() string { | ||
if t.Value == "" { | ||
return t.Key + ":" + string(t.Effect) | ||
} | ||
return t.Key + "=" + t.Value + ":" + string(t.Effect) | ||
} | ||
|
||
func (t Toleration) ToV1() v1.Toleration { | ||
return v1.Toleration(t) | ||
} | ||
|
||
func (n NodeSelector) Notation() string { | ||
for k, v := range n { | ||
return k + "=" + v | ||
} | ||
return "" | ||
} | ||
|
||
var ( | ||
GvisorToleration = Toleration{ | ||
Key: "sandbox.gke.io/runtime", | ||
Operator: v1.TolerationOpEqual, | ||
Value: "gvisor", | ||
Effect: v1.TaintEffectNoSchedule, | ||
} | ||
GvisorNodeSelector = NodeSelector{ | ||
"sandbox.gke.io/runtime": "gvisor", | ||
} | ||
) |
Oops, something went wrong.