File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,14 @@ for repo in "${staging_repos[@]}"; do
60
60
touch " ${KUBE_ROOT} /staging/src/${repo} /BUILD"
61
61
done
62
62
63
+ # Warning: Please be careful when ignoring these pkg-config errors.
64
+ # As gazelle doesn't support pkg-config, if we suppress these errors here, we actually need to modify the script below to handle it manually.
65
+ # For instance, in the case of `libseccomp`, we set the link option `-lseccomp` to make it work properly.
66
+ KNOWN_PKG_CONFIG_ERRORS=(
67
+ " vendor/github.com/seccomp/libseccomp-golang/seccomp(_internal)?.go: pkg-config not supported: #cgo pkg-config: libseccomp"
68
+ " vendor/github.com/google/cadvisor/nvm/machine_libipmctl.go: pkg-config not supported: #cgo pkg-config: libipmctl"
69
+ )
70
+
63
71
# Run gazelle to update Go rules in BUILD files.
64
72
# filter out known pkg-config error (see buildozer workaround below)
65
73
# NOTE: the `|| exit "${PIPESTATUS[0]}"` is to ignore grep errors
@@ -69,7 +77,7 @@ gazelle fix \
69
77
-mode=fix \
70
78
-repo_root " ${KUBE_ROOT} " \
71
79
" ${KUBE_ROOT} " \
72
- 2>&1 | grep -Ev " vendor/github.com/seccomp/libseccomp-golang/seccomp(_internal)?.go: pkg-config not supported: #cgo pkg-config: libseccomp " || (exit " ${PIPESTATUS[0]} " )
80
+ 2>&1 | grep -Ev " $( kube::util::join \| " ${KNOWN_PKG_CONFIG_ERRORS[@]} " ) " || (exit " ${PIPESTATUS[0]} " )
73
81
74
82
# Run kazel to update the pkg-srcs and all-srcs rules as well as handle
75
83
# Kubernetes code generators.
You can’t perform that action at this time.
0 commit comments