mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Only test events on GCE.
This commit is contained in:
parent
67adf6473e
commit
4dbdfd7935
@ -171,6 +171,16 @@ func TestPodUpdate(c *client.Client) bool {
|
|||||||
|
|
||||||
// TestKubeletSendsEvent checks that kubelets and scheduler send events about pods scheduling and running.
|
// TestKubeletSendsEvent checks that kubelets and scheduler send events about pods scheduling and running.
|
||||||
func TestKubeletSendsEvent(c *client.Client) bool {
|
func TestKubeletSendsEvent(c *client.Client) bool {
|
||||||
|
provider := os.Getenv("KUBERNETES_PROVIDER")
|
||||||
|
if provider == "" {
|
||||||
|
glog.Errorf("unable to detect cloud type.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if provider != "gce" {
|
||||||
|
glog.Infof("skipping TestKubeletSendsEvent on cloud provider %s", provider)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
podClient := c.Pods(api.NamespaceDefault)
|
podClient := c.Pods(api.NamespaceDefault)
|
||||||
|
|
||||||
pod := loadPodOrDie("./api/examples/pod.json")
|
pod := loadPodOrDie("./api/examples/pod.json")
|
||||||
@ -204,6 +214,7 @@ func TestKubeletSendsEvent(c *client.Client) bool {
|
|||||||
"involvedObject.kind": "Pod",
|
"involvedObject.kind": "Pod",
|
||||||
"involvedObject.namespace": api.NamespaceDefault,
|
"involvedObject.namespace": api.NamespaceDefault,
|
||||||
"source": "scheduler",
|
"source": "scheduler",
|
||||||
|
"time": value,
|
||||||
}.AsSelector(),
|
}.AsSelector(),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -265,6 +276,8 @@ func main() {
|
|||||||
if !testPassed {
|
if !testPassed {
|
||||||
passed = false
|
passed = false
|
||||||
}
|
}
|
||||||
|
// TODO: clean up objects created during a test after the test, so cases
|
||||||
|
// are independent.
|
||||||
}
|
}
|
||||||
if !passed {
|
if !passed {
|
||||||
glog.Fatalf("Tests failed")
|
glog.Fatalf("Tests failed")
|
||||||
|
Loading…
Reference in New Issue
Block a user