What happened?
Our corporate network cannot access public source-code hosts such as GitHub. We mirror the CRD manifests we need in a private repository on our internal Git server and use that repository as a project dependency.
The CLI cannot authenticate to that repository when it is accessed by crossplane dependency add or crossplane project build.
This leaves us unable to:
- Add the Git dependency to a project in the first place.
- Build a project when its dependency schemas need to be generated or refreshed.
This is surprising because crossplane dependency update-cache already supports Git-over-HTTPS authentication with:
--git-token / CROSSPLANE_GIT_TOKEN
--git-username / CROSSPLANE_GIT_USERNAME
The equivalent options are not available to dependency add or project build.
How can we reproduce it?
dependency add rejects the authentication flag:
$ crossplane dependency add --git-token=not-a-real-token
crossplane: error: unknown flag --git-token
The same flag is available on dependency update-cache:
$ crossplane dependency update-cache --help
...
--git-token=STRING Token for git HTTPS authentication ($CROSSPLANE_GIT_TOKEN).
--git-username="x-access-token"
Username for git HTTPS authentication ($CROSSPLANE_GIT_USERNAME).
I expect this workflow to work:
export CROSSPLANE_GIT_TOKEN=<read-only-token>
crossplane dependency add \
https://<git-server>/<organization>/<repository>.git \
--git-ref main \
--git-path config/crd/bases
After the dependency has been added, a regular build should also be able to access it:
Both commands should use credentials supplied through environment variables. Credentials must not be written to crossplane-project.yaml, included in the repository URL, or exposed in logs and error messages.
I would be happy to contribute a fix for this issue.
What environment did it happen in?
- Crossplane CLI version:
v2.5.0
- Platform:
linux/amd64
- Crossplane version: not applicable
What happened?
Our corporate network cannot access public source-code hosts such as GitHub. We mirror the CRD manifests we need in a private repository on our internal Git server and use that repository as a project dependency.
The CLI cannot authenticate to that repository when it is accessed by
crossplane dependency addorcrossplane project build.This leaves us unable to:
This is surprising because
crossplane dependency update-cachealready supports Git-over-HTTPS authentication with:--git-token/CROSSPLANE_GIT_TOKEN--git-username/CROSSPLANE_GIT_USERNAMEThe equivalent options are not available to
dependency addorproject build.How can we reproduce it?
dependency addrejects the authentication flag:The same flag is available on
dependency update-cache:I expect this workflow to work:
After the dependency has been added, a regular build should also be able to access it:
Both commands should use credentials supplied through environment variables. Credentials must not be written to
crossplane-project.yaml, included in the repository URL, or exposed in logs and error messages.I would be happy to contribute a fix for this issue.
What environment did it happen in?
v2.5.0linux/amd64