michalklempa / docker-nifi-registry

Unofficial Docker Image For NiFi Registry
Apache License 2.0
25 stars 13 forks source link

Error cloning repository with default `FLOW_PROVIDER_GIT_REMOTE_TO_PUSH` as blank #23

Open nononsensetekkie opened 3 years ago

nononsensetekkie commented 3 years ago

The documentation indicates that FLOW_PROVIDER_GIT_REMOTE_TO_PUSH is default to empty. This is a valid use-case in production deployment when wanting to access the read-only Git repository as the GitFlowPersistenceProvider.

Current implementation throws an error when setting FLOW_PROVIDER_GIT_REMOTE_TO_PUSH to blank due to the git clone command explicitly specifying the --origin or -o flag.

nifi-registry_1  | git clone -o $FLOW_PROVIDER_GIT_REMOTE_TO_PUSH -b $GIT_CHECKOUT_BRANCH $GIT_REMOTE_URL $FLOW_PROVIDER_GIT_FLOW_STORAGE_DIRECTORY

nifi-registry_1  | fatal: Too many arguments.
nifi-registry_1  |
nifi-registry_1  | usage: git clone [<options>] [--] <repo> [<dir>]
nifi-registry_1  |     -o, --origin <name>   use <name> instead of 'origin' to track upstream

It may be necessary to check for empty FLOW_PROVIDER_GIT_REMOTE_TO_PUSH and exclude the entire option for -o $FLOW_PROVIDER_GIT_REMOTE_TO_PUSH from the git clone command.