EDITD / kubetools

:nut_and_bolt: Kubetools is a tool and processes for developing and deploying microservices to Kubernetes.
MIT License
13 stars 2 forks source link

Entrypoint join in run_container loses command escaping #105

Closed eatoncns closed 3 years ago

eatoncns commented 3 years ago

As an example in our crawler_stats repo we have an upgrade command like:

 command: [
      curl, -X, PUT,
      'http://crawler-stats-elasticsearch:9200/crawler_stats_dev/crawl/_mapping',
      -H, 'Content-Type: application/json',
      -d@/opt/crawler_stats/mappings/mappings.json
    ]

After change in https://github.com/EDITD/kubetools/pull/95 this is now " ".joined to override the entrypoint. The problem in this case is that the space in Content-Type: application/json is then interpreted by the shell and the command fails.

['docker-compose', '--project-directory', '.', '--project-name', 'crawlerstatsd803929dprcacheoption', '--file', '/jenkins/workspace/ub_crawler_stats_pr-cache-option/.kubetools/d803929dprcacheoption-compose.yml', 'run', '--entrypoint', 'curl -X PUT http://crawler-stats-elasticsearch:9200/crawler_stats_dev/crawl/_mapping -H Content-Type: application/json -d@/opt/crawler_stats/mappings/mappings.json', 'webserver']