diff --git a/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go b/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go index 06484de..7bdfd19 100644 --- a/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go +++ b/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go @@ -150,7 +150,7 @@ func (pb *PodPatchBuilder) handleJavaAgentInit(opt *inject.PatchOptions, pod *co defaultProperties := make(map[string]string) - if validVersions[annonations[customJavaAgentVersion]] { + if val, ok := annonations[customJavaAgentVersion]; ok && (validVersions[val] && val != "") { kubeClient := opt.KubeClient pluginCm, err := kubeClient.CoreV1().ConfigMaps(util.RootNamespace).Get(context.Background(), "plugin-default.properties", metav1.GetOptions{})