Skip to content

Commit

Permalink
fix(*) remove circular dependency on the Istio submodule (#2742)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jpeach authored Sep 8, 2021
1 parent d5af0df commit 6f2b621
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1,374 deletions.
138 changes: 1 addition & 137 deletions go.sum

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions pkg/transparentproxy/config/config.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
package config

type TransparentProxyConfig struct {
DryRun bool
Verbose bool
RedirectPortOutBound string
RedirectInBound bool
RedirectPortInBound string
RedirectPortInBoundV6 string
ExcludeInboundPorts string
ExcludeOutboundPorts string
UID string
GID string
RedirectDNS bool
RedirectAllDNSTraffic bool
AgentDNSListenerPort string
DNSUpstreamTargetChain string
}
import "github.com/kumahq/kuma/pkg/transparentproxy/istio"

// TransparentProxyConfig defines the configuration for all transparent
// proxy configurations, not just the Istio one.
//
// We alias the types in reverse here to avoid an import loop (the Istio
// submodule depending on Kuma for the config type).
type TransparentProxyConfig = istio.TransparentProxyConfig
18 changes: 18 additions & 0 deletions pkg/transparentproxy/istio/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package istio

type TransparentProxyConfig struct {
DryRun bool
Verbose bool
RedirectPortOutBound string
RedirectInBound bool
RedirectPortInBound string
RedirectPortInBoundV6 string
ExcludeInboundPorts string
ExcludeOutboundPorts string
UID string
GID string
RedirectDNS bool
RedirectAllDNSTraffic bool
AgentDNSListenerPort string
DNSUpstreamTargetChain string
}
8 changes: 5 additions & 3 deletions pkg/transparentproxy/istio/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module github.com/kumahq/kuma/pkg/transparentproxy/istio
go 1.16

require (
github.com/miekg/dns v1.0.14
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.2.1 // indirect
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
// fetched with go get istio.io/istio/tools/istio-iptables@1.7.8
istio.io/istio v0.0.0-20210223230603-30e54dcb8a1c
golang.org/x/sys v0.0.0-20210510120138-977fb7262007
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
istio.io/pkg v0.0.0-20201202160453-b7f8c8c88ca3
)
Loading

0 comments on commit 6f2b621

Please sign in to comment.