Fix the relative path problem when running quay from non-root
This commit is contained in:
parent
ee67674e5b
commit
3b79955c8c
3 changed files with 12 additions and 9 deletions
|
@ -23,11 +23,12 @@ def test_path_is_dockerfile(input, expected_path, expected_file):
|
|||
assert actual_file == expected_file
|
||||
|
||||
@pytest.mark.parametrize('build_config,context,dockerfile_path', [
|
||||
({}, "", ""),
|
||||
({'build_subdir': "/builddir/Dockerfile"}, "", "/builddir/Dockerfile"),
|
||||
({'context': "/builddir"}, "/builddir", ""),
|
||||
({'context': "/builddir", 'build_subdir': "/builddir/Dockerfile"}, "/builddir", "Dockerfile"),
|
||||
({'context': "/some_other_dir/Dockerfile", 'build_subdir': "/builddir/Dockerfile"}, "/builddir", "Dockerfile"),
|
||||
({}, '', ''),
|
||||
({'build_subdir': '/builddir/Dockerfile'}, '', '/builddir/Dockerfile'),
|
||||
({'context': '/builddir'}, '/builddir', ''),
|
||||
({'context': '/builddir', 'build_subdir': '/builddir/Dockerfile'}, '/builddir', 'Dockerfile'),
|
||||
({'context': '/some_other_dir/Dockerfile', 'build_subdir': '/builddir/Dockerfile'}, '/builddir', 'Dockerfile'),
|
||||
({'context': '/', 'build_subdir':'Dockerfile'}, '/', 'Dockerfile')
|
||||
])
|
||||
def test_extract_dockerfile_args(build_config, context, dockerfile_path):
|
||||
actual_context, actual_dockerfile_path = BuildComponent.extract_dockerfile_args(build_config)
|
||||
|
|
Reference in a new issue