package inject import ( "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" "testing" ) func Test_containsEnvoyContainer(t *testing.T) { type args struct { pod *corev1.Pod } tests := []struct { name string args args want bool }{ { name: "contains envoy container", args: args{ pod: &corev1.Pod{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Name: "envoy", }, }, }, }, }, want: true, }, { name: "doesn't contains envoy container", args: args{ pod: &corev1.Pod{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ { Name: "other", }, }, }, }, }, want: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, _ := containsEnvoyContainer(tt.args.pod) assert.Equal(t, tt.want, got) }) } }