File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 47
47
# The array and map in `unwanted-dependencies.json` are in alphabetical order.
48
48
go run k8s.io/kubernetes/cmd/dependencyverifier " ${KUBE_ROOT} /hack/unwanted-dependencies.json"
49
49
50
+ k8s_module_regex=" k8s[.]io/(kubernetes"
51
+ for repo in $( kube::util::list_staging_repos) ; do
52
+ k8s_module_regex=" ${k8s_module_regex} |${repo} "
53
+ done
54
+ k8s_module_regex=" ${k8s_module_regex} )"
55
+
56
+ recursive_dependencies=$( go mod graph | grep -E " ${k8s_module_regex} " | grep -E -v " ^${k8s_module_regex} " || true)
57
+ if [[ -n " ${recursive_dependencies} " ]]; then
58
+ echo " These external modules depend on k8s.io/kubernetes or staging modules, which is not allowed:"
59
+ echo " "
60
+ echo " ${recursive_dependencies} "
61
+ fi
62
+
50
63
outdated=$( go list -m -json all | jq -r "
51
64
select(.Replace.Version != null) |
52
65
select(.Version != .Replace.Version) |
@@ -90,7 +103,7 @@ if [[ -n "${unused}" ]]; then
90
103
echo " ${unused} " | xargs -L 1 echo ' go mod edit -dropreplace'
91
104
fi
92
105
93
- if [[ -n " ${unused}${outdated}${noncanonical} " ]]; then
106
+ if [[ -n " ${unused}${outdated}${noncanonical}${recursive_dependencies} " ]]; then
94
107
rc=1
95
108
else
96
109
echo " All pinned versions of checked dependencies match their preferred version."
You can’t perform that action at this time.
0 commit comments