Skip to content

Commit

Permalink
Implement requirement.json
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Oct 22, 2024
1 parent 38f6cc1 commit 4b742d0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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
19 changes: 19 additions & 0 deletions lib-injection/requirements.json
Original file line number Diff line number Diff line change
@@ -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": []
}
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.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"}},
]
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.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"}},
]

0 comments on commit 4b742d0

Please sign in to comment.