@@ -743,6 +743,55 @@ func Test_otelCollectorFeature_VersionCheck(t *testing.T) {
743743 },
744744 },
745745 },
746+ {
747+ Name : "UseStandaloneImage with full image in Name field 7.67.0+" ,
748+ DDA : testutils .NewDatadogAgentBuilder ().
749+ WithOTelCollectorEnabled (true ).
750+ WithOTelCollectorUseStandaloneImage (true ).
751+ WithComponentOverride (v2alpha1 .NodeAgentComponentName , v2alpha1.DatadogAgentComponentOverride {
752+ Image : & v2alpha1.AgentImageConfig {
753+ Name : "gcr.io/datadoghq/agent:7.67.0-full" ,
754+ },
755+ }).
756+ Build (),
757+ WantConfigure : true ,
758+ Agent : & test.ComponentTest {
759+ CreateFunc : func (t testing.TB ) (feature.PodTemplateManagers , string ) {
760+ newPTS := corev1.PodTemplateSpec {
761+ Spec : corev1.PodSpec {
762+ Containers : []corev1.Container {
763+ {
764+ Name : string (apicommon .CoreAgentContainerName ),
765+ Image : "gcr.io/datadoghq/agent:7.67.0-full" ,
766+ Command : []string {"agent" , "run" },
767+ },
768+ {
769+ Name : string (apicommon .OtelAgent ),
770+ Image : "gcr.io/datadoghq/agent:7.67.0-full" , // This will be changed to ddot-collector
771+ Command : []string {"otel-agent" },
772+ },
773+ },
774+ },
775+ }
776+ return fake .NewPodTemplateManagers (t , newPTS ), kubernetes .DefaultProvider
777+ },
778+ WantFunc : func (t testing.TB , mgrInterface feature.PodTemplateManagers ) {
779+ mgr := mgrInterface .(* fake.PodTemplateManagers )
780+ // Version 7.67.0 is >= 7.67.0, so UseStandaloneImage should be enabled
781+ // When full image is provided in Name field, it should be used as-is for non-OTel containers
782+ // and converted to ddot-collector for OTel Agent
783+ for _ , container := range mgr .PodTemplateSpec ().Spec .Containers {
784+ if container .Name == string (apicommon .OtelAgent ) {
785+ // OTel Agent should use ddot-collector image derived from the full image name
786+ assert .Equal (t , "gcr.io/datadoghq/ddot-collector:7.67.0" , container .Image )
787+ } else {
788+ // Other containers should use the full image as provided
789+ assert .Equal (t , "gcr.io/datadoghq/agent:7.67.0-full" , container .Image )
790+ }
791+ }
792+ },
793+ },
794+ },
746795 }
747796
748797 tests .Run (t , buildOtelCollectorFeature )
0 commit comments