Skip to content

Commit

Permalink
Merge pull request #4019 from DataDog/tonycthsu/denylist
Browse files Browse the repository at this point in the history
Implement `requirement.json` for injection
  • Loading branch information
lloeki authored Oct 30, 2024
2 parents 1ec3900 + 357ec4c commit d361376
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ package-oci:
- build-gem
- install-dependencies

requirements_json_test:
rules:
- when: on_success
variables:
REQUIREMENTS_BLOCK_JSON_PATH: "lib-injection/test_block.json"
REQUIREMENTS_ALLOW_JSON_PATH: "lib-injection/test_allow.json"

onboarding_tests_installer:
parallel:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .gitlab/prepare-oci-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
33 changes: 33 additions & 0 deletions lib-injection/requirements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$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.27",
"description": "libffi needs memfd_create"
},
{
"arch": "arm64",
"supported": true,
"min": "2.27",
"description": "libffi needs memfd_create"
}
],
"musl": [
{
"arch": "x86",
"supported": false,
"description": "no musl build"
},
{
"arch": "arm64",
"supported": false,
"description": "no musl build"
}
]
},
"deny": []
}
4 changes: 4 additions & 0 deletions lib-injection/test_allow.json
Original file line number Diff line number Diff line change
@@ -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"}}
]
4 changes: 4 additions & 0 deletions lib-injection/test_block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{"name": "❌ 2.26 glibc x86" ,"filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x86" , "libc": "glibc:2.26"}},
{"name": "❌ 2.26 glibc arm64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.26"}}
]

0 comments on commit d361376

Please sign in to comment.