File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,23 @@ case "${1:-}" in
58
58
;;
59
59
esac
60
60
61
+ # let us log all errors before we exit
62
+ rc=0
63
+
64
+ # List of dependencies we need to avoid dragging back into kubernetes/kubernetes
65
+ forbidden_repos=(
66
+ " k8s.io/klog" # we have switched to klog v2, so avoid klog v1
67
+ )
68
+ for forbidden_repo in " ${forbidden_repos[@]} " ; do
69
+ deps_on_forbidden=$( go mod graph | grep " ${forbidden_repo} @" || echo " " )
70
+ if [ -n " ${deps_on_forbidden} " ]; then
71
+ kube::log::error " The following have transitive dependencies on ${forbidden_repo} , which is not allowed:"
72
+ echo " ${deps_on_forbidden} "
73
+ echo " "
74
+ rc=1
75
+ fi
76
+ done
77
+
61
78
outdated=$( go list -m -json all | jq -r "
62
79
select(.Replace.Version != null) |
63
80
select(.Version != .Replace.Version) |
@@ -89,8 +106,8 @@ if [[ -n "${unused}" ]]; then
89
106
fi
90
107
91
108
if [[ -n " ${unused}${outdated} " ]]; then
92
- exit 1
109
+ rc= 1
93
110
fi
94
111
95
112
echo " All pinned versions of checked dependencies match their preferred version."
96
- exit 0
113
+ exit $rc
You can’t perform that action at this time.
0 commit comments