update
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-12-30 00:00:25 +08:00
parent c12435eb7f
commit 36357cdd13
2 changed files with 68 additions and 12 deletions
+7 -6
View File
@@ -16,7 +16,7 @@ func (sl ServiceList) toServiceEnv() map[string]string {
func (sl ServiceList) toDestinationConfig(nameSpace string) (string, error) {
retConfig := ""
for _, service := range sl {
config, err := service.toDestinationConfig(nameSpace)
config, err := service.toDestinationConfig(nameSpace, sl.toServiceEnv())
if err != nil {
return "", err
}
@@ -25,15 +25,16 @@ func (sl ServiceList) toDestinationConfig(nameSpace string) (string, error) {
return retConfig, nil
}
func (s Service) toDestinationConfig(nameSpace string) (string, error) {
func (s Service) toDestinationConfig(nameSpace string, serviceEnv map[string]string) (string, error) {
var handler Handler
switch s.Type {
case go_handler.TypeGolang:
handler = go_handler.GoServiceHandler{
NameSpace: nameSpace,
Name: s.Name,
Root: s.Root,
Port: s.Port,
NameSpace: nameSpace,
Name: s.Name,
Root: s.Root,
Port: s.Port,
ServiceEnv: serviceEnv,
}
}