CM-904: Fix clientgen scripts when .git points at a missing submodule gitdir#396
Conversation
… gitdir Signed-off-by: Bharath B <bhb@redhat.com>
|
@bharath-b-rh: This pull request references CM-904 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughTwo shell scripts were updated to resolve Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/cherrypick cert-manager-1.19 no user facing changes hence adding required labels |
|
@bharath-b-rh: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@bharath-b-rh: This pull request references CM-904 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bharath-b-rh, chiragkyal The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2beb5f9
into
openshift:master
|
@bharath-b-rh: new pull request created: #397 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Problem
hack/update-clientgen.shusedgit rev-parse --show-toplevelto find the repo root. When this repository is used as a git submodule,.gitis a file that references the parent repo’smodules/...path. Container builds (e.g. Konflux) often copy only the operator tree into the image, so that referenced path does not exist andgit rev-parsefails with:fatal: not a git repository: .../.git/modules/cert-manager-operatorThat breaks make generate during
make buildin the Dockerfile.Solution
Resolve
SCRIPT_ROOTthe same way in spirit as the top of theMakefile: trygit rev-parse --show-toplevel, and if that fails, use the directory containing hack/ derived from the script’s location (BASH_SOURCE). The fallback is wrapped in a subshell so||/&&precedence does not runpwdwhengitalready succeeded.Files
hack/update-clientgen.sh— primary fix for image/CI builds.hack/verify-clientgen.sh— sameSCRIPT_ROOTlogic for consistency.