diff --git a/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go b/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go index 64b7d2e..dea4e5b 100644 --- a/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go +++ b/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go @@ -119,12 +119,6 @@ func (pb *PodPatchBuilder) handleJavaAgentInit(opt *inject.PatchOptions, pod *co }) } - // kubeClient := opt.KubeClient - // pluginCm, err := kubeClient.CoreV1().ConfigMaps(util.RootNamespace).Get(context.Background(), - // "plugin-default.properties", metav1.GetOptions{}) - // if err != nil { - // return err - // } defaultParam := map[string]string{ "MicroserviceName": opt.Annotations[util.SidecarServiceName], "PolarisServerIP": strings.Split(polarisapi.PolarisGrpc, ":")[0], @@ -143,28 +137,6 @@ func (pb *PodPatchBuilder) handleJavaAgentInit(opt *inject.PatchOptions, pod *co polarisAddressValue := fmt.Sprintf("grpc\\://%s\\:%s", defaultParam["PolarisServerIP"], defaultParam["PolarisDiscoverPort"]) defaultProperties[polarisAddressKey] = polarisAddressValue - // tpl, err := template.New(pluginType).Parse(pluginCm.Data[nameOfPluginDefault(pluginType)]) - // if err != nil { - // return err - // } - // buf := new(bytes.Buffer) - // if err := tpl.Execute(buf, defaultParam); err != nil { - // return err - // } - // defaultProperties := map[string]string{} - // scanner := bufio.NewScanner(strings.NewReader(buf.String())) - // scanner.Split(bufio.ScanLines) - // for scanner.Scan() { - // line := scanner.Text() - // // 注释不放在 defaultProperties 中 - // if !strings.HasPrefix(line, "#") { - // kvs := strings.Split(line, "=") - // if len(kvs) == 2 && kvs[0] != "" && kvs[1] != "" { - // defaultProperties[strings.TrimSpace(kvs[0])] = strings.TrimSpace(kvs[1]) - // } - // } - // } - // 查看用户是否自定义了相关配置信息 // 需要根据用户的自定义参数信息,将 agent 的特定 application.properties 文件注入到 javaagent-init 中 if properties, ok := annonations[customJavaAgentPluginConfig]; ok {