(t *testing.T)
| 667 | }) |
| 668 | |
| 669 | func TestBuildImagePullSecretsByEnv(t *testing.T) { |
| 670 | tests := []struct { |
| 671 | value string |
| 672 | expected []corev1.LocalObjectReference |
| 673 | }{ |
| 674 | { |
| 675 | value: "", |
| 676 | expected: nil, |
| 677 | }, |
| 678 | { |
| 679 | value: "[{\"name\":\"test\"}]", |
| 680 | expected: []corev1.LocalObjectReference{ |
| 681 | { |
| 682 | Name: "test", |
| 683 | }, |
| 684 | }, |
| 685 | }, |
| 686 | } |
| 687 | |
| 688 | Context("test BuildImagePullSecrets", func() { |
| 689 | It("Should succeed with no error", func() { |
| 690 | for _, t := range tests { |
| 691 | viper.Set(constant.KBImagePullSecrets, t.value) |
| 692 | secrets := BuildImagePullSecrets() |
| 693 | if t.value == "" { |
| 694 | Expect(len(secrets)).To(Equal(0)) |
| 695 | } else { |
| 696 | Expect(secrets).To(Equal(t.expected)) |
| 697 | } |
| 698 | } |
| 699 | }) |
| 700 | }) |
| 701 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…