File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
install/installer/pkg/components/spicedb Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
74
74
},
75
75
Env : common .CustomizeEnvvar (ctx , Component , common .MergeEnv (
76
76
common .DefaultEnv (& ctx .Config ),
77
- dbEnvVars (ctx ),
78
77
spicedbEnvVars (ctx ),
79
78
)),
80
79
Ports : []corev1.ContainerPort {
@@ -139,15 +138,24 @@ func dbEnvVars(ctx *common.RenderContext) []corev1.EnvVar {
139
138
containerEnvVars := common .DatabaseEnv (& ctx .Config )
140
139
141
140
if ctx .Config .Database .CloudSQLGlobal != nil {
142
- containerEnvVars = append (containerEnvVars , common .MergeEnv (
141
+ var withoutDBHost []corev1.EnvVar
142
+
143
+ for _ , v := range containerEnvVars {
144
+ if v .Name == "DB_HOST" {
145
+ continue
146
+ }
147
+ withoutDBHost = append (withoutDBHost , v )
148
+ }
149
+
150
+ withoutDBHost = append (withoutDBHost ,
143
151
// Override the DB host to point to global cloudsql
144
- []corev1.EnvVar {
145
- {
146
- Name : "DB_HOST" ,
147
- Value : cloudsql .ComponentGlobal ,
148
- },
152
+ corev1.EnvVar {
153
+ Name : "DB_HOST" ,
154
+ Value : cloudsql .ComponentGlobal ,
149
155
},
150
- )... )
156
+ )
157
+
158
+ containerEnvVars = withoutDBHost
151
159
}
152
160
153
161
return containerEnvVars
You can’t perform that action at this time.
0 commit comments