From 3ec56459466629a3d8f4bb34e4c965efed8803e1 Mon Sep 17 00:00:00 2001 From: liaochuntao Date: Thu, 1 Feb 2024 11:25:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Djava-agent=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E6=97=B6plugin.enable=E6=A0=BC=E5=BC=8F=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=20(#167)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/inject/pkg/kube/inject/apply/javaagent/patch.go | 8 ++++---- pkg/inject/pkg/kube/inject/inject.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go b/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go index 91823f29..8ca20be4 100644 --- a/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go +++ b/pkg/inject/pkg/kube/inject/apply/javaagent/patch.go @@ -37,10 +37,10 @@ import ( // Java Agent 场景下的特殊 annonations 信息 const ( - customJavaAgentVersion = "polarismesh.cn/java-agent/version" - customJavaAgentPluginFramework = "polarismesh.cn/java-agent/framework-name" - customJavaAgentPluginFrameworkVersion = "polarismesh.cn/java-agent/framework-version" - customJavaAgentPluginConfig = "polarismesh.cn/java-agent/config" + customJavaAgentVersion = "polarismesh.cn/javaagentVersion" + customJavaAgentPluginFramework = "polarismesh.cn/javaagentFrameworkName" + customJavaAgentPluginFrameworkVersion = "polarismesh.cn/javaagentFrameworkVersion" + customJavaAgentPluginConfig = "polarismesh.cn/javaagentConfig" ) const ( diff --git a/pkg/inject/pkg/kube/inject/inject.go b/pkg/inject/pkg/kube/inject/inject.go index b8894172..b8c5bd26 100644 --- a/pkg/inject/pkg/kube/inject/inject.go +++ b/pkg/inject/pkg/kube/inject/inject.go @@ -270,7 +270,7 @@ func validateBool(value string) error { // getSidecarMode 获取 sidecar 注入模式 func (wh *Webhook) getSidecarMode(namespace string, pod *corev1.Pod) utils.SidecarMode { // 这里主要是处理北极星 sidecar, 优先级: pod.annotations > namespace.labels > configmap - if val, ok := pod.Annotations["polarismesh.cn/java-agent"]; ok && val == "true" { + if val, ok := pod.Annotations["polarismesh.cn/javaagent"]; ok && val == "true" { return utils.SidecarForJavaAgent } sidecarMode := ""