|
@@ -255,39 +255,39 @@ func RunWaitingCluster() {
|
|
|
yamlPathBak := infra.ApplicationYaml.K8s.PodYamlDir + "bak/" + podYaml
|
|
|
fmt.Println(yamlPath, yamlPathBak)
|
|
|
// 5
|
|
|
- podString, err := util.ReadFile(infra.ApplicationYaml.K8s.VtdPodTemplateYaml)
|
|
|
- if err != nil {
|
|
|
- infra.GlobalLogger.Error(err)
|
|
|
- continue
|
|
|
- }
|
|
|
- podString = strings.Replace(podString, "pod-name", podName, -1)
|
|
|
- podString = strings.Replace(podString, "namespace-name", namespaceName, -1)
|
|
|
- podString = strings.Replace(podString, "node-name", nodeName, -1)
|
|
|
- podString = strings.Replace(podString, "algorithm-image", algorithmImageName, -1)
|
|
|
- podString = strings.Replace(podString, "vtd-container", vtdContainer, -1)
|
|
|
- podString = strings.Replace(podString, "vtd-image", vtdImage, -1)
|
|
|
- if firstTaskCache.EquipmentType == "PU_JIN_DUO_GONG_NENG_CHE" { // 多功能车仿真
|
|
|
+ podString := ""
|
|
|
+ if firstTaskCache.EquipmentType == "JIN_LONG_BA_SHI" || firstTaskCache.EquipmentType == "PU_JIN_DUO_GONG_NENG_CHE" { // 多功能车仿真
|
|
|
+ if podString, err = util.ReadFile(infra.ApplicationYaml.K8s.VtdPodTemplateYamlPjisuv); err != nil {
|
|
|
+ infra.GlobalLogger.Error(err)
|
|
|
+ continue
|
|
|
+ }
|
|
|
podString = strings.Replace(podString, "vtd-command", infra.ApplicationYaml.K8s.VtdCommandPjisuv, -1)
|
|
|
- } else {
|
|
|
- podString = strings.Replace(podString, "vtd-command", infra.ApplicationYaml.K8s.VtdCommandPjibot, -1)
|
|
|
- }
|
|
|
- podString = strings.Replace(podString, "platform-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
|
- podString = strings.Replace(podString, "simulation-cloud-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
|
- podString = strings.Replace(podString, "platform-type", "\""+infra.ApplicationYaml.K8s.PlatformType+"\"", -1)
|
|
|
- if firstTaskCache.EquipmentType == "JIN_LONG_BA_SHI" || firstTaskCache.EquipmentType == "PU_JIN_DUO_GONG_NENG_CHE" {
|
|
|
podString = strings.Replace(podString, "oss-type", infra.ApplicationYaml.OssCicv.Type, -1)
|
|
|
podString = strings.Replace(podString, "oss-ip", infra.ApplicationYaml.OssCicv.Endpoint, -1) // 不带http://前缀
|
|
|
podString = strings.Replace(podString, "oss-access-key", infra.ApplicationYaml.OssCicv.AccessKeyId, -1)
|
|
|
podString = strings.Replace(podString, "oss-secret-key", infra.ApplicationYaml.OssCicv.AccessKeySecret, -1)
|
|
|
podString = strings.Replace(podString, "oss-bucket", infra.ApplicationYaml.OssCicv.BucketName, -1)
|
|
|
} else {
|
|
|
+ if podString, err = util.ReadFile(infra.ApplicationYaml.K8s.VtdPodTemplateYamlPjibot); err != nil {
|
|
|
+ infra.GlobalLogger.Error(err)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ podString = strings.Replace(podString, "vtd-command", infra.ApplicationYaml.K8s.VtdCommandPjibot, -1)
|
|
|
podString = strings.Replace(podString, "oss-type", infra.ApplicationYaml.OssPji.Type, -1)
|
|
|
podString = strings.Replace(podString, "oss-ip", infra.ApplicationYaml.OssPji.Endpoint, -1) // 不带http://前缀
|
|
|
podString = strings.Replace(podString, "oss-access-key", infra.ApplicationYaml.OssPji.AccessKeyId, -1)
|
|
|
podString = strings.Replace(podString, "oss-secret-key", infra.ApplicationYaml.OssPji.AccessKeySecret, -1)
|
|
|
podString = strings.Replace(podString, "oss-bucket", infra.ApplicationYaml.OssPji.BucketName, -1)
|
|
|
}
|
|
|
-
|
|
|
+ podString = strings.Replace(podString, "pod-name", podName, -1)
|
|
|
+ podString = strings.Replace(podString, "namespace-name", namespaceName, -1)
|
|
|
+ podString = strings.Replace(podString, "node-name", nodeName, -1)
|
|
|
+ podString = strings.Replace(podString, "algorithm-image", algorithmImageName, -1)
|
|
|
+ podString = strings.Replace(podString, "vtd-container", vtdContainer, -1)
|
|
|
+ podString = strings.Replace(podString, "vtd-image", vtdImage, -1)
|
|
|
+ podString = strings.Replace(podString, "platform-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
|
+ podString = strings.Replace(podString, "simulation-cloud-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
|
+ podString = strings.Replace(podString, "platform-type", "\""+infra.ApplicationYaml.K8s.PlatformType+"\"", -1)
|
|
|
podString = strings.Replace(podString, "kafka-ip", infra.ApplicationYaml.Kafka.Broker, -1)
|
|
|
podString = strings.Replace(podString, "kafka-topic", projectId, -1)
|
|
|
podString = strings.Replace(podString, "kafka-partition", "\""+util.ToString(infra.ApplicationYaml.Kafka.Partition)+"\"", -1)
|