Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/test/dockerutil/dockerutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ func IsRestoreSupported() bool {
return major <= 27
}

// IsAnnotationsSupported returns true if the docker version supports annotations.
// Docker annotations were introduced in API v1.44 (Docker v25.0).
func IsAnnotationsSupported() bool {
major, _ := getDockerVersion()
return major >= 25
}

// RuntimePath returns the binary path for the current runtime.
func RuntimePath() (string, error) {
rs, err := runtimeMap()
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ func TestLifeCycle(t *testing.T) {
}

func TestDisallowRootfsTarAnnotation(t *testing.T) {
if !dockerutil.IsAnnotationsSupported() {
t.Skip("Docker version does not support annotations (< 25.0).")
}
ctx := context.Background()
d := dockerutil.MakeContainer(ctx, t)
defer d.CleanUp(ctx)
Expand Down
1 change: 1 addition & 0 deletions test/syscalls/linux/landlock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ TEST(LandlockTest, AddNetPortRuleWithoutHandledNetFails) {
// non-tty normally fails with ENOTTY; under a ruleset that handles IOCTL_DEV
// but does not grant it on the device, the ioctl is rejected earlier with
// EACCES instead.
// TODO(aaltinay): delete this line.
TEST(LandlockTest, IoctlDevDeniedWithoutRule) {
SKIP_IF(IsRunningOnGvisor());
SKIP_IF(LandlockAbiVersion() < 5);
Expand Down
Loading