mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-01 03:07:51 +08:00
[FIX] fix startup sequence control bug
This commit is contained in:
parent
db60916be2
commit
9c4132ba02
@ -23,6 +23,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
|
||||
@ -80,6 +81,9 @@ func NewDependServiceHealthController() (*DependServiceHealthController, error)
|
||||
}
|
||||
if dependCount, err := strconv.Atoi(os.Getenv("DEPEND_SERVICE_COUNT")); err == nil {
|
||||
dsc.dependServiceCount = dependCount
|
||||
} else {
|
||||
depServices := os.Getenv("DEPEND_SERVICE")
|
||||
dsc.dependServiceCount = len(strings.Split(depServices, ","))
|
||||
}
|
||||
dsc.endpointClient = v2.NewEndpointDiscoveryServiceClient(cli)
|
||||
return &dsc, nil
|
||||
|
@ -196,6 +196,7 @@ func createEnv(as *v1.AppService, dbmanager db.Manager) (*[]corev1.EnvVar, error
|
||||
Depend += fmt.Sprintf("%s:%s", sa.ServiceAlias, sa.ServiceID)
|
||||
}
|
||||
envs = append(envs, corev1.EnvVar{Name: "DEPEND_SERVICE", Value: Depend})
|
||||
envs = append(envs, corev1.EnvVar{Name: "DEPEND_SERVICE_COUNT", Value: strconv.Itoa(len(serviceAliass))})
|
||||
as.NeedProxy = true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user