Skip to content

Commit eb2aeba

Browse files
committed
Add TenantLabel to config and update tenant label assignment in SGM
1 parent 19f0d62 commit eb2aeba

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/apm/sgm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (s *SgmAppender) Modify(ctx context.Context, target *v1.Deployment) (bool,
3737
added = true
3838
}
3939
if _, ok := target.Spec.Template.Labels["sgm.jd.com/tenant"]; !ok {
40-
target.Spec.Template.Labels["sgm.jd.com/tenant"] = target.Labels["sgm.jd.com/tenant"]
40+
target.Spec.Template.Labels["sgm.jd.com/tenant"] = target.Labels[config.TenantLabel]
4141
added = true
4242
}
4343
return added, nil

pkg/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
EnhanceTypeSidecar = "sidecar"
3535
SidecarEnhanceLabel = "sidecar.istio.io/inject"
3636
ApmTypeLabel = "jmsf.jd.com/apm"
37+
TenantLabel = "jmsf.jd.com/tenant"
3738
JdapApplicationLabel = "app.jdap.io/name"
3839
WebHookMatchKeyEnv = "JOYLIVE_MATCH_KEY"
3940
WebHookMatchValueEnv = "JOYLIVE_MATCH_VALUE"

0 commit comments

Comments
 (0)