Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EASEMESH_TAGS env for agent #115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions add-ons/shadow/pkg/handler/clone_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const (

shadowDeploymentNameSuffix = "-shadow"

easemeshTagsConfigEnv = "EASEMESH_TAGS"
databaseShadowConfigEnv = "EASE_RESOURCE_DATABASE"
kafkaShadowConfigEnv = "EASE_RESOURCE_KAFKA"
rabbitmqShadowConfigEnv = "EASE_RESOURCE_RABBITMQ"
Expand Down
16 changes: 15 additions & 1 deletion add-ons/shadow/pkg/handler/deployment_cloner.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,29 @@ func shadowConfigurationMap(shadowService *object.ShadowService) map[string]inte
shadowConfigs[redisShadowConfigEnv] = shadowService.Redis
shadowConfigs[kafkaShadowConfigEnv] = shadowService.Kafka
shadowConfigs[rabbitmqShadowConfigEnv] = shadowService.RabbitMQ
shadowConfigs[easemeshTagsConfigEnv] = defaultEaseMeshTags()
return shadowConfigs
}

func shadowConfigurationKeys() []string {
configKeys := []string{databaseShadowConfigEnv, elasticsearchShadowConfigEnv, redisShadowConfigEnv, kafkaShadowConfigEnv, rabbitmqShadowConfigEnv}
configKeys := []string{
databaseShadowConfigEnv,
elasticsearchShadowConfigEnv,
redisShadowConfigEnv,
kafkaShadowConfigEnv,
rabbitmqShadowConfigEnv,
easemeshTagsConfigEnv,
}
sort.Strings(configKeys)
return configKeys
}

func defaultEaseMeshTags() map[string]string {
m := map[string]string{
"label.local": "shadow",
}
return m
}
func sourceName(name string) string {
return strings.TrimSuffix(name, shadowDeploymentNameSuffix)
}
Expand Down
2 changes: 2 additions & 0 deletions add-ons/shadow/pkg/handler/fake/fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ spec:
env:
- name: JAVA_TOOL_OPTIONS
value: ' -javaagent:/agent-volume/easeagent.jar -Deaseagent.log.conf=/agent-volume/log4j2.xml '
- name: EASEMESH_TAGS
value: '{"label.local":"shadow"}'
image: megaease/spring-petclinic-visits-service:latest
imagePullPolicy: Always
lifecycle:
Expand Down