From c2c89d8f241fcdcd3b05454126b02daeac387694 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 11 一月 2024 14:13:29 +0800 Subject: [PATCH] env完善 --- src/k8s/create_srm.go | 33 +++------------------------------ 1 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/k8s/create_srm.go b/src/k8s/create_srm.go index e612e14..a9c9dce 100644 --- a/src/k8s/create_srm.go +++ b/src/k8s/create_srm.go @@ -47,13 +47,8 @@ func (c *SrmCreate) CreateEnv(config Config, pairs map[string]string) []apiv1.EnvVar { envs := []apiv1.EnvVar{ { - Name: "DB_HOST", - ValueFrom: &apiv1.EnvVarSource{ - FieldRef: &apiv1.ObjectFieldSelector{ - APIVersion: "v1", - FieldPath: "status.hostIP", - }, - }, + Name: "DB_HOST", + Value: config.DBHost, }, { Name: "DB_NAME", @@ -61,7 +56,7 @@ }, { Name: "DB_PORT", - Value: strconv.Itoa(6446), + Value: strconv.Itoa(3306), }, { Name: "DB_USER", @@ -73,28 +68,6 @@ }, } - if config.ALHost != "" { - envs = append(envs, apiv1.EnvVar{ - Name: "AL_HOST", - Value: config.ALHost, - }) - } - - if config.NodeID != "" { - envs = append(envs, apiv1.EnvVar{ - Name: "NODE_ID", - Value: config.NodeID, - }) - } - - if len(pairs) > 0 { - for name, value := range pairs { - envs = append(envs, apiv1.EnvVar{ - Name: name, - Value: value, - }) - } - } for name, value := range pairs { envs = append(envs, apiv1.EnvVar{ Name: name, -- Gitblit v1.8.0