Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependency in the Istio plugin module #2087

Closed
jpeach opened this issue Jun 3, 2021 · 0 comments · Fixed by #2742
Closed

Circular dependency in the Istio plugin module #2087

jpeach opened this issue Jun 3, 2021 · 0 comments · Fixed by #2742

Comments

@jpeach
Copy link
Contributor

jpeach commented Jun 3, 2021

Summary

jpeach@greenling:~/upstream/konghq/kuma/pkg/transparentproxy/istio$ go mod tidy
go: found github.com/kumahq/kuma/pkg/transparentproxy/config in github.com/kumahq/kuma v0.0.0-00010101000000-000000000000
go: github.com/kumahq/kuma@v0.0.0-00010101000000-000000000000 requires
	github.com/kumahq/kuma/pkg/transparentproxy/istio@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000

Steps To Reproduce

  1. try to tidy go modules in the istio plugin

Additional Details & Logs

The Istio plugin has a dependency on the top-level kuma module in root.go:

$ git grep kumahq . | grep -v github.com/kumahq/kuma/pkg/transparentproxy/istio
go.mod:	github.com/kumahq/kuma => ../../..
go.mod:	github.com/kumahq/kuma/api => ../../../api
go.mod:	github.com/kumahq/kuma/pkg/plugins/resources/k8s/native => ../../plugins/resources/k8s/native
istio.go:	"github.com/kumahq/kuma/pkg/transparentproxy/config"
tools/istio-iptables/pkg/cmd/root.go:	// ref. https://github.com/kumahq/kuma/issues/2046

And Kuma has a dependency on the Istio plugin:

jpeach@greenling:~/upstream/konghq/kuma$ git grep github.com/kumahq/kuma/pkg/transparentproxy/istio
...
pkg/transparentproxy/transparentproxy.go:       "github.com/kumahq/kuma/pkg/transparentproxy/istio"
jpeach added a commit that referenced this issue Sep 8, 2021
The Istio submodule imports Kuma config definitions, and Kuma calls
functions from the Istio submodule. Break the circular dependency by
moving the config definitions into the Istio submodule, even though
they more properly belong in Kuma itself.

This makes it possible to run `go mod tidy` in the Istio submodule.

This fixes #2087.

Signed-off-by: James Peach <james.peach@konghq.com>
mergify bot pushed a commit that referenced this issue Sep 8, 2021
The Istio submodule imports Kuma config definitions, and Kuma calls
functions from the Istio submodule. Break the circular dependency by
moving the config definitions into the Istio submodule, even though
they more properly belong in Kuma itself.

This makes it possible to run `go mod tidy` in the Istio submodule.

This fixes #2087.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit 6f2b621)
nikita15p pushed a commit to nikita15p/kuma that referenced this issue Sep 28, 2021
The Istio submodule imports Kuma config definitions, and Kuma calls
functions from the Istio submodule. Break the circular dependency by
moving the config definitions into the Istio submodule, even though
they more properly belong in Kuma itself.

This makes it possible to run `go mod tidy` in the Istio submodule.

This fixes kumahq#2087.

Signed-off-by: James Peach <james.peach@konghq.com>
nikita15p pushed a commit to nikita15p/kuma that referenced this issue Sep 28, 2021
The Istio submodule imports Kuma config definitions, and Kuma calls
functions from the Istio submodule. Break the circular dependency by
moving the config definitions into the Istio submodule, even though
they more properly belong in Kuma itself.

This makes it possible to run `go mod tidy` in the Istio submodule.

This fixes kumahq#2087.

Signed-off-by: James Peach <james.peach@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant