Skip to content

Commit

Permalink
Compatible with older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhanliu committed Jul 1, 2024
1 parent 8928670 commit fa69949
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/inject/pkg/kube/inject/apply/javaagent/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ func (pb *PodPatchBuilder) handleJavaAgentInit(opt *inject.PatchOptions, pod *co
"MicroserviceName": opt.Annotations[util.SidecarServiceName],
"PolarisServerIP": strings.Split(polarisapi.PolarisGrpc, ":")[0],
"PolarisDiscoverPort": strings.Split(polarisapi.PolarisGrpc, ":")[1],
"PolarisConfigIP": strings.Split(polarisapi.PolarisConfigGrpc, ":")[0],
"PolarisConfigPort": strings.Split(polarisapi.PolarisConfigGrpc, ":")[1],
}

defaultProperties := make(map[string]string)
Expand Down Expand Up @@ -187,6 +189,10 @@ func (pb *PodPatchBuilder) handleJavaAgentInit(opt *inject.PatchOptions, pod *co
polarisAddressKey := "spring.cloud.polaris.address"
polarisAddressValue := fmt.Sprintf("grpc\\://%s\\:%s", defaultParam["PolarisServerIP"], defaultParam["PolarisDiscoverPort"])
defaultProperties[polarisAddressKey] = polarisAddressValue

polarisConfigAddressKey := "spring.cloud.polaris.address"
polarisConfigAddressValue := fmt.Sprintf("grpc\\://%s\\:%s", defaultParam["PolarisConfigIP"], defaultParam["PolarisConfigPort"])
defaultProperties[polarisConfigAddressKey] = polarisConfigAddressValue
}

// 查看用户是否自定义了相关配置信息
Expand Down

0 comments on commit fa69949

Please sign in to comment.