Skip to content

fix: remove replace directive from go.mod to enable go install - #2107

Open
waterWang wants to merge 1 commit into
kubernetes:mainfrom
waterWang:fix/go-install-replace-directive
Open

fix: remove replace directive from go.mod to enable go install#2107
waterWang wants to merge 1 commit into
kubernetes:mainfrom
waterWang:fix/go-install-replace-directive

Conversation

@waterWang

Copy link
Copy Markdown

Fixes #2106

Problem

go install github.com/kubernetes/kompose@latest fails because the go.mod file contains a replace directive pointing to a remote module:

go: github.com/kubernetes/kompose@latest (in github.com/kubernetes/kompose@v1.38.0):
	The go.mod file for the module providing named packages contains one or
	more replace directives. It must not contain directives that would cause
	it to be interpreted differently than if it were the main module.

Root Cause

The replace directive was used to map github.com/openshift/api v3.9.0+incompatible to a specific pseudo-version v0.0.0-20230704153349-abb98ff04d03. When building from the module root (the main module), this is fine. But go install from outside the module rejects replace directives that point to remote modules.

Fix

  • Changed the require entry from github.com/openshift/api v3.9.0+incompatible to github.com/openshift/api v0.0.0-20230704153349-abb98ff04d03
  • Removed the replace directive

The pseudo-version was already present in go.sum, so no module hash changes are needed.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 16, 2026

Copy link
Copy Markdown

CLA Not Signed

@kubernetes-prow

Copy link
Copy Markdown

Welcome @waterWang!

It looks like this is your first PR to kubernetes/kompose 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kompose has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 16, 2026
@waterWang waterWang changed the title fix: remove replace directive from go.mod to enable go install [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] fix: remove replace directive from go.mod to enable go install Aug 16, 2026
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: waterWang
Once this PR has been reviewed and has the lgtm label, please assign tessaio for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested review from TessaIO and cdrage August 16, 2026 16:55
@kubernetes-prow kubernetes-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 16, 2026
@waterWang
waterWang force-pushed the fix/go-install-replace-directive branch from 9e1ff5a to 7d89e8c Compare August 16, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] go install github.com/kubernetes/kompose@latest is not working correctly

1 participant