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

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

@basilv

Description

@basilv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions