Skip to content

Commit

Permalink
test/lint: add lxd-agent-imports
Browse files Browse the repository at this point in the history
Closes #13132

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
  • Loading branch information
simondeziel committed Mar 27, 2024
1 parent de121fc commit 891bda2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/lint/lxd-agent-imports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -eu

echo "Checking for imports that have been added to the lxd-agent..."

OUT=$(go list -f '{{ join .Imports "\n" }}' ./lxd-agent | grep -F . | sort -u | diff -u test/lxd-agent-godeps.list - || true)
if [ -n "${OUT}" ]; then
echo "ERROR: you added a new dependency to the lxd-agent; please make sure this is what you want"
echo "${OUT}"
exit 1
fi
27 changes: 27 additions & 0 deletions test/lxd-agent-godeps.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
github.com/canonical/lxd/client
github.com/canonical/lxd/lxd-agent/api
github.com/canonical/lxd/lxd/daemon
github.com/canonical/lxd/lxd/db/operationtype
github.com/canonical/lxd/lxd/device/config
github.com/canonical/lxd/lxd/events
github.com/canonical/lxd/lxd/instance/instancetype
github.com/canonical/lxd/lxd/ip
github.com/canonical/lxd/lxd/metrics
github.com/canonical/lxd/lxd/operations
github.com/canonical/lxd/lxd/response
github.com/canonical/lxd/lxd/storage/filesystem
github.com/canonical/lxd/lxd/util
github.com/canonical/lxd/lxd/vsock
github.com/canonical/lxd/shared
github.com/canonical/lxd/shared/api
github.com/canonical/lxd/shared/logger
github.com/canonical/lxd/shared/revert
github.com/canonical/lxd/shared/version
github.com/canonical/lxd/shared/ws
github.com/gorilla/mux
github.com/gorilla/websocket
github.com/mdlayher/vsock
github.com/pkg/sftp
github.com/spf13/cobra
golang.org/x/sys/unix
gopkg.in/yaml.v2

0 comments on commit 891bda2

Please sign in to comment.