<p>I was trying to add a poststart hook for my pod using curl, say sending a message to my slack channel
in shell, the command looks like this</p>
<pre class="lang-sh prettyprint-override"><code>curl -d &quot;text=Hi I am a bot that can post messages to any public channel.&quot; -d &quot;channel=C1234567&quot; -H &quot;Authorization: Bearer xoxb-xxxxxxxxxxxxxxxx&quot; -X POST https://slack.com/api/chat.postMessage
</code></pre>
<p>and in my pod definition, i tried sth like this</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: curlimages/curl
      env:
        - name: TOKEN
          valueFrom:
            configMapKeyRef:
              name: my-config
              key: token
      command: [&quot;sleep&quot;]
      args: [&quot;3000&quot;]
      lifecycle:
        postStart:
          exec:
            command:
              - &quot;sh&quot;
              - &quot;-c&quot;
              - |
                curl -d &quot;text=Hi going to start.&quot; -d &quot;channel=C1234567&quot; -H &quot;Authorization: Bearer $(TOKEN)&quot; -X POST https://slack.com/api/chat.postMessage
</code></pre>
<p>Unlike the container-&gt;command, it has <code>args</code> parameter which i could pass multi line command with quote, but in lifecycle-&gt;poststart-&gt;exec-&gt;command it doesn't support args parameter</p>
<p>I also tried sth like but no luck</p>
<pre><code>command: [&quot;curl&quot;,&quot;-d&quot;,&quot;text=Hi going to start.&quot;,....]
</code></pre>
<p>but i never got my slack message</p>
<p>My question is, how can i pass long curl command with quote in lifecycle-&gt;poststart-&gt;exec-&gt;command?</p>

Neo Gónzáles
<p>it finally solved by replacing () with {}
to use a env variable in command, it should be ${TOKEN}</p>
