(t *testing.T)
| 571 | } |
| 572 | |
| 573 | func TestStatusWaitMultipleNamespaces(t *testing.T) { |
| 574 | t.Parallel() |
| 575 | tests := []struct { |
| 576 | name string |
| 577 | objManifests []string |
| 578 | expectErrStrs []string |
| 579 | testFunc func(*statusWaiter, ResourceList, time.Duration) error |
| 580 | }{ |
| 581 | { |
| 582 | name: "pods in multiple namespaces", |
| 583 | objManifests: []string{podNamespace1Manifest, podNamespace2Manifest}, |
| 584 | testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error { |
| 585 | return sw.Wait(rl, timeout) |
| 586 | }, |
| 587 | }, |
| 588 | { |
| 589 | name: "hooks in multiple namespaces", |
| 590 | objManifests: []string{jobNamespace1CompleteManifest, podNamespace2SucceededManifest}, |
| 591 | testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error { |
| 592 | return sw.WatchUntilReady(rl, timeout) |
| 593 | }, |
| 594 | }, |
| 595 | { |
| 596 | name: "error when resource not ready in one namespace", |
| 597 | objManifests: []string{podNamespace1NoStatusManifest, podNamespace2Manifest}, |
| 598 | expectErrStrs: []string{"resource Pod/namespace-1/pod-ns1 not ready. status: InProgress", "context deadline exceeded"}, |
| 599 | testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error { |
| 600 | return sw.Wait(rl, timeout) |
| 601 | }, |
| 602 | }, |
| 603 | { |
| 604 | name: "delete resources in multiple namespaces", |
| 605 | objManifests: []string{podNamespace1Manifest, podNamespace2Manifest}, |
| 606 | testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error { |
| 607 | return sw.WaitForDelete(rl, timeout) |
| 608 | }, |
| 609 | }, |
| 610 | { |
| 611 | name: "cluster-scoped resources work correctly with unrestricted permissions", |
| 612 | objManifests: []string{podNamespace1Manifest, clusterRoleManifest}, |
| 613 | testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error { |
| 614 | return sw.Wait(rl, timeout) |
| 615 | }, |
| 616 | }, |
| 617 | { |
| 618 | name: "namespace-scoped and cluster-scoped resources work together", |
| 619 | objManifests: []string{podNamespace1Manifest, podNamespace2Manifest, clusterRoleManifest}, |
| 620 | testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error { |
| 621 | return sw.Wait(rl, timeout) |
| 622 | }, |
| 623 | }, |
| 624 | { |
| 625 | name: "delete cluster-scoped resources works correctly", |
| 626 | objManifests: []string{podNamespace1Manifest, namespaceManifest}, |
| 627 | testFunc: func(sw *statusWaiter, rl ResourceList, timeout time.Duration) error { |
| 628 | return sw.WaitForDelete(rl, timeout) |
| 629 | }, |
| 630 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…