(t *testing.T)
| 627 | } |
| 628 | |
| 629 | func TestMultiSinkCache(t *testing.T) { |
| 630 | testPod := &v1.Pod{ |
| 631 | ObjectMeta: metav1.ObjectMeta{ |
| 632 | SelfLink: "/api/version/pods/foo", |
| 633 | Name: "foo", |
| 634 | Namespace: "baz", |
| 635 | UID: "bar", |
| 636 | }, |
| 637 | } |
| 638 | testPod2 := &v1.Pod{ |
| 639 | ObjectMeta: metav1.ObjectMeta{ |
| 640 | SelfLink: "/api/version/pods/foo", |
| 641 | Name: "foo", |
| 642 | Namespace: "baz", |
| 643 | UID: "differentUid", |
| 644 | }, |
| 645 | } |
| 646 | testRef, err := ref.GetPartialReference(scheme.Scheme, testPod, "spec.containers[2]") |
| 647 | if err != nil { |
| 648 | t.Fatal(err) |
| 649 | } |
| 650 | testRef2, err := ref.GetPartialReference(scheme.Scheme, testPod2, "spec.containers[3]") |
| 651 | if err != nil { |
| 652 | t.Fatal(err) |
| 653 | } |
| 654 | table := []struct { |
| 655 | obj k8sruntime.Object |
| 656 | eventtype string |
| 657 | reason string |
| 658 | messageFmt string |
| 659 | elements []interface{} |
| 660 | expect *v1.Event |
| 661 | expectLog string |
| 662 | expectUpdate bool |
| 663 | }{ |
| 664 | { |
| 665 | obj: testRef, |
| 666 | eventtype: v1.EventTypeNormal, |
| 667 | reason: "Started", |
| 668 | messageFmt: "some verbose message: %v", |
| 669 | elements: []interface{}{1}, |
| 670 | expect: &v1.Event{ |
| 671 | ObjectMeta: metav1.ObjectMeta{ |
| 672 | Name: "foo", |
| 673 | Namespace: "baz", |
| 674 | }, |
| 675 | InvolvedObject: v1.ObjectReference{ |
| 676 | Kind: "Pod", |
| 677 | Name: "foo", |
| 678 | Namespace: "baz", |
| 679 | UID: "bar", |
| 680 | APIVersion: "version", |
| 681 | FieldPath: "spec.containers[2]", |
| 682 | }, |
| 683 | Reason: "Started", |
| 684 | Message: "some verbose message: 1", |
| 685 | Source: v1.EventSource{Component: "eventTest"}, |
| 686 | Count: 1, |
nothing calls this directly
no test coverage detected