[project-clone] Initialize and update submodules when present in project #1167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
If a cloned-and-checked-out project has a
.gitmodules
file in the root of the repo, rungit submodule update --init --recursive
inside the project to clone all submodules.Failures in setting up submodules result only in a warning log and do not prevent the project from being 'set up', as the user can later initialize submodules manually.
What issues does this PR fix or reference?
Closes #949
Is it tested? How?
Can be tested by cloning https://github.com/dkwon17/submodule-test
Changes are built and pushed to
quay.io/amisevsk/project-clone:submodules
. To test changes with an existing DevWorkspace Operator, set theRELATED_IMAGE_project_clone
environment variable toquay.io/amisevsk/project-clone:submodules
.spec.install.spec.deployments[0]
and wait for the controller to roll outPR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-path
to trigger)v8-devworkspace-operator-e2e
: DevWorkspace e2e testv8-che-happy-path
: Happy path for verification integration with Che