@@ -32,10 +32,8 @@ func TestSetOtelCommonFieldsDefaults(t *testing.T) {
3232 expectedError error
3333 }{
3434 {
35- name : "Basic Initialization" ,
36- initialCommonFields : & otelv1beta1.OpenTelemetryCommonFields {
37- Args : map [string ]string {},
38- },
35+ name : "Basic Initialization" ,
36+ initialCommonFields : & otelv1beta1.OpenTelemetryCommonFields {},
3937 additionalArgs : map [string ]string {
4038 "key1" : "value1" ,
4139 },
@@ -139,6 +137,50 @@ func TestSetOtelCommonFieldsDefaults(t *testing.T) {
139137 expectedResult : nil ,
140138 expectedError : nil ,
141139 },
140+ {
141+ name : "custom image" ,
142+ initialCommonFields : & otelv1beta1.OpenTelemetryCommonFields {
143+ Image : "custom-image:latest" ,
144+ },
145+ additionalArgs : map [string ]string {},
146+ saName : "test-sa" ,
147+ expectedResult : & otelv1beta1.OpenTelemetryCommonFields {
148+ Image : "custom-image:latest" ,
149+ ServiceAccount : "test-sa" ,
150+ Args : map [string ]string {},
151+ VolumeMounts : []corev1.VolumeMount {
152+ {
153+ Name : "varlog" ,
154+ ReadOnly : true ,
155+ MountPath : "/var/log" ,
156+ },
157+ {
158+ Name : "varlibdockercontainers" ,
159+ ReadOnly : true ,
160+ MountPath : "/var/lib/docker/containers" ,
161+ },
162+ },
163+ Volumes : []corev1.Volume {
164+ {
165+ Name : "varlog" ,
166+ VolumeSource : corev1.VolumeSource {
167+ HostPath : & corev1.HostPathVolumeSource {
168+ Path : "/var/log" ,
169+ },
170+ },
171+ },
172+ {
173+ Name : "varlibdockercontainers" ,
174+ VolumeSource : corev1.VolumeSource {
175+ HostPath : & corev1.HostPathVolumeSource {
176+ Path : "/var/lib/docker/containers" ,
177+ },
178+ },
179+ },
180+ },
181+ },
182+ expectedError : nil ,
183+ },
142184 }
143185
144186 for _ , tt := range tests {
0 commit comments