Skip to content

Commit

Permalink
Add EASEMESH_TAGS env for agent
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyingjie committed Jan 10, 2022
1 parent c6f6f4c commit e056619
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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

0 comments on commit e056619

Please sign in to comment.