mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-10 19:29:46 +00:00
validate yaml for extraneous fields in pkg build
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
committed by
Avi Deitcher
parent
9da6903609
commit
358803fcc7
2
test/cases/000_build/090_validate_build_yaml/Dockerfile
Normal file
2
test/cases/000_build/090_validate_build_yaml/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
||||
FROM alpine:3.22
|
||||
|
7
test/cases/000_build/090_validate_build_yaml/build.yml
Normal file
7
test/cases/000_build/090_validate_build_yaml/build.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
image: build-args-test
|
||||
network: true
|
||||
arches:
|
||||
- amd64
|
||||
- arm64
|
||||
# should error out on this unknown field
|
||||
unknownField: "abc"
|
19
test/cases/000_build/090_validate_build_yaml/test.sh
Executable file
19
test/cases/000_build/090_validate_build_yaml/test.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: Check that the build-args are correctly passed to Dockerfiles
|
||||
# LABELS:
|
||||
# REPEAT:
|
||||
|
||||
set -ex
|
||||
|
||||
# Source libraries. Uncomment if needed/defined
|
||||
#. "${RT_LIB}"
|
||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||
|
||||
# Test code goes here
|
||||
RESULT=$(linuxkit pkg build --force . 2>&1 || echo FAILED)
|
||||
if [ "${RESULT}" != "FAILED" ]; then
|
||||
echo "Build should have failed with invalid yaml, instead was ${RESULT}"
|
||||
fi
|
||||
echo "Summary: correctly detected invalid yaml"
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user