Skip to content

Commit

Permalink
Try to keep backward compatibility with older autoinstrumentation images
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx committed Oct 16, 2024
1 parent 5c792b1 commit 824ac80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/instrumentation/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ func injectPythonSDK(pythonSpec v1alpha1.Python, pod corev1.Pod, index int, plat
},
}})

// copy the default glibc based dir if the autoInstrumentationSrc does not exist to not break compat with old images
pod.Spec.InitContainers = append(pod.Spec.InitContainers, corev1.Container{
Name: pythonInitContainerName,
Image: pythonSpec.Image,
Command: []string{"cp", "-r", autoInstrumentationSrc, pythonInstrMountPath},
Command: []string{"test", "-d", autoInstrumentationSrc, "&&", "cp", "-r", autoInstrumentationSrc, pythonInstrMountPath, "||", "cp", "-r", glibcLinuxAutoInstrumentationSrc, pythonInstrMountPath},
Resources: pythonSpec.Resources,
VolumeMounts: []corev1.VolumeMount{{
Name: pythonVolumeName,
Expand Down

0 comments on commit 824ac80

Please sign in to comment.