From 4b742d038b852c139ab35412bbffe33c287f0283 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Tue, 22 Oct 2024 17:27:29 +0200 Subject: [PATCH] Implement requirement.json --- .gitlab-ci.yml | 6 ++++++ .gitlab/prepare-oci-package.sh | 1 + lib-injection/requirements.json | 19 +++++++++++++++++++ lib-injection/test_allow.json | 4 ++++ lib-injection/test_block.json | 4 ++++ 5 files changed, 34 insertions(+) create mode 100644 lib-injection/requirements.json create mode 100644 lib-injection/test_allow.json create mode 100644 lib-injection/test_block.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2948a30f937..8dff87a5766 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -115,6 +115,12 @@ package-oci: - build-gem - install-dependencies +requirements_json_test: + stage: package + variables: + REQUIREMENTS_BLOCK_JSON_PATH: "lib-injection/test_block.json" + REQUIREMENTS_ALLOW_JSON_PATH: "lib-injection/test_allow.json" + onboarding_tests_installer: parallel: matrix: diff --git a/.gitlab/prepare-oci-package.sh b/.gitlab/prepare-oci-package.sh index cf96732ba47..d051f359c15 100755 --- a/.gitlab/prepare-oci-package.sh +++ b/.gitlab/prepare-oci-package.sh @@ -5,6 +5,7 @@ set -e mkdir sources cp ../lib-injection/host_inject.rb sources +cp ../lib-injection/requirements.json sources/requirements.json # Kubernetes injection expects a different path ln -rs sources/host_inject.rb sources/auto_inject.rb diff --git a/lib-injection/requirements.json b/lib-injection/requirements.json new file mode 100644 index 00000000000..43c798d7ac6 --- /dev/null +++ b/lib-injection/requirements.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://raw.githubusercontent.com/DataDog/auto_inject/refs/heads/main/preload_go/cmd/library_requirements_tester/testdata/requirements_schema.json", + "version": 1, + "native_deps": { + "glibc": [ + { + "arch": "x86", + "supported": true, + "min": "2.28" + }, + { + "arch": "arm64", + "supported": true, + "min": "2.28" + } + ] + }, + "deny": [] +} diff --git a/lib-injection/test_allow.json b/lib-injection/test_allow.json new file mode 100644 index 00000000000..ccfdd703f79 --- /dev/null +++ b/lib-injection/test_allow.json @@ -0,0 +1,4 @@ +[ + {"name": "✅ 2.28 glibc x86" ,"filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x86" , "libc": "glibc:2.28"}}, + {"name": "✅ 2.28 glibc arm64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.28"}}, +] diff --git a/lib-injection/test_block.json b/lib-injection/test_block.json new file mode 100644 index 00000000000..958fdca1b80 --- /dev/null +++ b/lib-injection/test_block.json @@ -0,0 +1,4 @@ +[ + {"name": "❌ 2.27 glibc x86" ,"filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x86" , "libc": "glibc:2.27"}}, + {"name": "❌ 2.27 glibc arm64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.27"}}, +]