Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
🚀
This server has been upgraded to GitLab release
15.7
.
🚀
Open sidebar
memoriav
Memobase 2020
services
Import Process
Import API
Commits
b793caf7
Commit
b793caf7
authored
Jun 30, 2020
by
Lionel Walter
Browse files
Use configMapName as well
parent
e87b2797
Changes
1
Hide whitespace changes
Inline
Side-by-side
import_api_app/resources/JobStart.py
View file @
b793caf7
...
...
@@ -60,20 +60,26 @@ class JobStart(Resource):
response
=
requests
.
get
(
mapping_file_url
)
mapping_file_content
=
response
.
text
config_map_name
=
process_id
+
"-mapper-service-mapping-config"
# Instantiate the configmap object
metadata
=
client
.
V1ObjectMeta
(
labels
=
dict
(
app
=
"import-api-app"
),
name
=
process_id
+
"-mapper-service-mapping-config"
,
name
=
config_map_name
,
namespace
=
current_app
.
config
[
'NAMESPACE'
],
)
configmap
=
client
.
V1ConfigMap
(
api_version
=
"v1"
,
kind
=
"ConfigMap"
,
data
=
dict
(
test
=
mapping_file_content
),
data
=
dict
(
mapping
=
mapping_file_content
),
metadata
=
metadata
)
# use mapping as well as name for the config as above
job_parameters
[
'configFileName'
]
=
"mapping"
job_parameters
[
'configMapName'
]
=
config_map_name
v1
=
client
.
CoreV1Api
()
v1
.
create_namespaced_config_map
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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