Verified Commit 060ab56f authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

handle array values in helm command arguments

Unfortunately, helm can't handle arrays as argument values directly. A
special "index" syntax is needed. See issue
https://github.com/helm/helm/issues/1987 and solution for details.
parent 19a0c4dc
Pipeline #37656 passed with stages
in 1 minute and 21 seconds
......@@ -72,13 +72,18 @@ class DeleteService:
set_values['deleteObject'] +
' / id=' + set_values['deleteId'] +
' / session=' + set_values['sessionId'])
job_args = [
'--' + set_values['deleteObject'] + '-filter',
set_values['deleteId'],
set_values['sessionId']
]
# We need to handle the fact that we can't use an array as argument
# value when calling helm. For details see
# https://github.com/helm/helm/issues/1987#issuecomment-682352463.
job_args = {
'jobArgs[0]': '--' + set_values['deleteObject'] + '-filter',
'jobArgs[1]': set_values['deleteId'],
}
if dryrun:
job_args.append('--dry-run')
job_args.update({'jobArgs[2]': '--dry-run',
'jobArgs[3]': set_values['sessionId']})
else:
job_args.update({'jobArgs[2]': set_values['sessionId']})
job_args = {'jobArgs': job_args}
cp = self.helm.install( # noqa: F841
chart=os.path.join(self.root_path, "charts", 'dd-marker-prod'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment