As you can see, whenever the image exists locally (because we just pulled it, or it was pulled long before), one of the record contains the image's digest.
Therefore, by splitting stdout by newlines (\n), parsing each line as a JSON record, and checking if one of the record contains a digest, we should be able to determine with accuracy if an image has been pulled or not. Way more accurately than checking if the number of characters in stdout is bellow or above 512.
Changes
[x] :sparkles: Find Digest in stdout stream to determine if image has been successfully pulled
Decision Record
After pulling an image, the
stdout
stream contains a sequence of JSON records, one per line. For example:Or when the image already exists:
Or when failed:
As you can see, whenever the image exists locally (because we just pulled it, or it was pulled long before), one of the record contains the image's digest.
Therefore, by splitting
stdout
by newlines (\n
), parsing each line as a JSON record, and checking if one of the record contains a digest, we should be able to determine with accuracy if an image has been pulled or not. Way more accurately than checking if the number of characters instdout
is bellow or above 512.Changes