Skip to content
This repository has been archived by the owner on Jan 30, 2022. It is now read-only.

Support BuildConfig.spec.source.contextDir starting with '/' #114

Open
basilv opened this issue Jul 29, 2021 · 0 comments
Open

Support BuildConfig.spec.source.contextDir starting with '/' #114

basilv opened this issue Jul 29, 2021 · 0 comments

Comments

@basilv
Copy link

basilv commented Jul 29, 2021

When trying to reuse a provided OpenShift buildConfig template, they sometimes include a source.contextDir setting. In some cases (e.g. BCgov backupcontainer), the project's Dockerfile is expecting a contextDir to be used in the BuildConfig.

Context directories starting with a slash (e.g. '/docker') cause nrdk build to fail, it appears this happens in nrdk/src/pipeline-cli/openshift-client-x.ts when calling git rev-parse HEAD:${contextDir} (

.execSync('git', ['rev-parse', `HEAD:${contextDir}`], {
). The simple fix appears to be to strip the leading slash off of contextDir before invoking git rev-parse.

The workaround is to remove the leading slash from the contextDir value in the buildConfig template.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant