yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [1/4] yetus git commit: YETUS-514. docker gives multiple time formats
Date Fri, 07 Jul 2017 05:56:22 GMT
Repository: yetus
Updated Branches:
  refs/heads/master 10d4d13cc -> 3c28739fc


YETUS-514. docker gives multiple time formats

Signed-off-by: Sean Busbey <busbey@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/f8bfe0cc
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/f8bfe0cc
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/f8bfe0cc

Branch: refs/heads/master
Commit: f8bfe0cc219cb02997edf15a1c147fedd1a169a0
Parents: 10d4d13
Author: Allen Wittenauer <aw@apache.org>
Authored: Wed May 31 10:06:32 2017 -0700
Committer: Sean Busbey <busbey@apache.org>
Committed: Fri Jul 7 01:40:24 2017 -0400

----------------------------------------------------------------------
 precommit/core.d/docker.sh | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/f8bfe0cc/precommit/core.d/docker.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/docker.sh b/precommit/core.d/docker.sh
index 124aa0b..d8fae29 100755
--- a/precommit/core.d/docker.sh
+++ b/precommit/core.d/docker.sh
@@ -258,8 +258,10 @@ function dockerdate_to_ctime
     date -d "${mytime}" "+%s"
   else
 
-    # BSD date
-    date -j -f "%FT%T%z" "${mytime}" "+%s"
+    # BSD date; docker gives us two different format because fun
+    if ! date -j -f "%FT%T%z" "${mytime}" "+%s" 2>/dev/null; then
+      date -j -f "%FT%T" "${mytime}" "+%s"
+    fi
   fi
 }
 
@@ -385,6 +387,22 @@ function docker_image_maintenance_helper
   done
 }
 
+
+## @description  get sentinel-level docker images
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+## @param        args
+function docker_get_sentinel_images
+{
+  #shellcheck disable=SC2016
+  dockercmd images \
+    | tail -n +2 \
+    | "${GREP}" -v hours \
+    | "${AWK}" '{print $1":"$2}' \
+    | "${GREP}" -v "<none>:<none>"
+}
+
 ## @description  Remove untagged/unused images
 ## @audience     private
 ## @stability    evolving
@@ -426,8 +444,8 @@ function docker_image_maintenance
   fi
 
   echo "Other images:"
-  #shellcheck disable=SC2046,SC2016
-  docker_image_maintenance_helper $(dockercmd images | tail -n +2 | ${GREP} -v hours  | ${AWK}
'{print $1":"$2}')
+  #shellcheck disable=SC2046
+  docker_image_maintenance_helper $(docker_get_sentinel_images)
 }
 
 


Mime
View raw message