Improve idempotency for podman container module

Strip all registry values from "image" parameter in input.
Add this case to test.

Change-Id: I78656e48cf85a1a39f873ee40193765eecf02c56
This commit is contained in:
Sagi Shnaidman 2020-01-06 11:19:32 +02:00
parent be0bc2b1a4
commit 87d9e9d9a6
2 changed files with 5 additions and 2 deletions

View File

@ -1519,7 +1519,10 @@ class PodmanContainerDiff:
"docker.io/library/", "").replace(
"docker.io/", "").replace(
":latest", "")
after = self.params['image']
after = self.params['image'].replace(
"docker.io/library/", "").replace(
"docker.io/", "").replace(
":latest", "")
return self._diff_update_and_compare('image', before, after)
def diffparam_ipc(self):

View File

@ -239,7 +239,7 @@
- name: Recreate container with parameters
podman_container:
name: container
image: alpine:3.7
image: docker.io/alpine:3.7
state: started
command: sleep 1d
recreate: true