Skip to content

Commit

Permalink
feat:agent Automatic version matching
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhanliu committed Jul 1, 2024
1 parent 107dbda commit 805c929
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions pkg/inject/pkg/kube/inject/apply/javaagent/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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 {
Expand Down

0 comments on commit 805c929

Please sign in to comment.