Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rainbond2
Commits
702d0daa
Commit
702d0daa
authored
6 years ago
by
GLYASAI
Browse files
Options
Download
Email Patches
Plain Diff
[REV] parse environment variables into configuration files
parent
cda030eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
worker/appm/conversion/version.go
+6
-2
worker/appm/conversion/version.go
with
6 additions
and
2 deletions
+6
-2
worker/appm/conversion/version.go
+
6
-
2
View file @
702d0daa
...
...
@@ -345,7 +345,11 @@ func createVolumes(as *v1.AppService, version *dbmodel.VersionInfo, dbmanager db
logrus
.
Errorf
(
"there is no config files according to volume name(%s)"
,
v
.
VolumeName
)
return
nil
,
fmt
.
Errorf
(
"there is no config files according to volume name(%s)"
,
v
.
VolumeName
)
}
logrus
.
Debugf
(
"config files is %v"
,
cfs
)
envs
,
err
:=
createEnv
(
as
,
dbmanager
)
configs
:=
make
(
map
[
string
]
string
,
len
(
*
envs
))
for
_
,
env
:=
range
*
envs
{
configs
[
env
.
Name
]
=
env
.
Value
}
configMap
:=
&
corev1
.
ConfigMap
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
fmt
.
Sprintf
(
"manual%d"
,
v
.
ID
),
...
...
@@ -355,7 +359,7 @@ func createVolumes(as *v1.AppService, version *dbmodel.VersionInfo, dbmanager db
Data
:
make
(
map
[
string
]
string
),
}
for
_
,
cf
:=
range
cfs
{
configMap
.
Data
[
filepath
.
Base
(
v
.
VolumePath
)]
=
cf
.
FileContent
configMap
.
Data
[
filepath
.
Base
(
v
.
VolumePath
)]
=
util
.
ParseVariable
(
cf
.
FileContent
,
configs
)
}
as
.
SetConfigMap
(
configMap
)
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help