<p>Is calling Delete in the Kubernetes go API an idempotent operation, i.e. can it safely be called twice?
If so, is there any documentation defining this property?
The go code just states</p>
<blockquote>
<p>Delete deletes the given obj from Kubernetes cluster.</p>
</blockquote>
<p>Essentially, this statement is what one would expect anyway when looking at the code.</p>

Timm Felden
<p>The api service is based on http, so you can check <a href="https://www.rfc-editor.org/rfc/rfc7231" rel="nofollow noreferrer">RFC 7231</a> about that</p>
<blockquote>
<p>A request method is considered &quot;idempotent&quot; if the intended effect on the server of multiple identical requests with that method is the same as the effect for a single such request.  Of the request methods defined by this specification, PUT, DELETE, and safe request methods are idempotent.</p>
</blockquote>
<p>If your're using <code>kubectl</code> the delete command will fail on the second run, because the resource can not be found. You can prevent it from failing by using the <code>--ignore-not-found</code> flag.</p>
<pre class="lang-bash prettyprint-override"><code>$ kubectl run nginx --image nginx
pod/nginx created
$ kubectl delete pod nginx
pod &quot;nginx&quot; deleted 
$ kubectl delete pod nginx
Error from server (NotFound): pods &quot;nginx&quot; not found
$ kubectl delete pod nginx --ignore-not-found
</code></pre>
<p>So it's idempotent on the server but not on the client.</p>
