Skip to content

Commit

Permalink
added new functions to manage route configuration using policy routin…
Browse files Browse the repository at this point in the history
…g rules and custom routing tables
  • Loading branch information
alacuku committed May 26, 2021
1 parent 296c71d commit bd9336c
Show file tree
Hide file tree
Showing 9 changed files with 1,027 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -29,7 +29,7 @@ endif

# Run unit tests
unit: test-container
docker run --mount type=bind,src=$(shell pwd),dst=/go/src/liqo -w /go/src/liqo --rm liqo-test
docker run --cap-add=NET_ADMIN --mount type=bind,src=$(shell pwd),dst=/go/src/liqo -w /go/src/liqo --rm liqo-test

# Run e2e tests
e2e: gen
Expand Down Expand Up @@ -101,7 +101,7 @@ ifeq (, $(shell which protoc))
rm -rf $$PROTOC_TMP_DIR ;\
}
endif
PROTOC=$(shell which protoc)
PROTOC=$(shell which protoc)

# find or download controller-gen
# download controller-gen if necessary
Expand Down
2 changes: 1 addition & 1 deletion apis/net/v1alpha1/tunnelEndpointClient.go
Expand Up @@ -12,7 +12,7 @@ import (
crdclient "github.com/liqotech/liqo/pkg/crdClient"
)

// create a client for TunnelEndpoint CR using a provided kubeconfig.
// CreateTunnelEndpointClient creates a client for TunnelEndpoint CR using a provided kubeconfig.
func CreateTunnelEndpointClient(kubeconfig string) (*crdclient.CRDClient, error) {
var config *rest.Config
var err error
Expand Down
12 changes: 10 additions & 2 deletions apis/net/v1alpha1/tunnel_endpoint_types.go
Expand Up @@ -67,20 +67,28 @@ type TunnelEndpointStatus struct {
LocalEndpointIP string `json:"localTunnelPublicIP,omitempty"`
TunnelIFaceIndex int `json:"tunnelIFaceIndex,omitempty"`
TunnelIFaceName string `json:"tunnelIFaceName,omitempty"`
VethIFaceIndex int `json:"vethIFaceIndex,omitempty"`
VethIFaceName string `json:"vethIFaceName,omitempty"`
GatewayIP string `json:"gatewayIP,omitempty"`
Connection Connection `json:"connection,omitempty"`
}

// Connection holds the configuration and status of a vpn tunnel connecting to remote cluster.
type Connection struct {
Status ConnectionStatus `json:"status,omitempty"`
StatusMessage string `json:"statusMessage,omitempty"`
PeerConfiguration map[string]string `json:"peerConfiguration,omitempty"`
}

// ConnectionStatus type that describes the status of vpn connection with a remote cluster.
type ConnectionStatus string

const (
Connected ConnectionStatus = "connected"
Connecting ConnectionStatus = "connecting"
// Connected used when the connection is up and running.
Connected ConnectionStatus = "connected"
// Connecting used as temporary status while waiting for the vpn tunnel to come up.
Connecting ConnectionStatus = "connecting"
// ConnectionError used to se the status in case of errors.
ConnectionError ConnectionStatus = "error"
)

Expand Down
10 changes: 10 additions & 0 deletions deployments/liqo/crds/net.liqo.io_tunnelendpoints.yaml
Expand Up @@ -80,16 +80,22 @@ spec:
description: TunnelEndpointStatus defines the observed state of TunnelEndpoint.
properties:
connection:
description: Connection holds the configuration and status of a vpn
tunnel connecting to remote cluster.
properties:
peerConfiguration:
additionalProperties:
type: string
type: object
status:
description: ConnectionStatus type that describes the status of
vpn connection with a remote cluster.
type: string
statusMessage:
type: string
type: object
gatewayIP:
type: string
localExternalCIDR:
description: ExternalCIDR of local cluster.
type: string
Expand Down Expand Up @@ -123,6 +129,10 @@ spec:
type: integer
tunnelIFaceName:
type: string
vethIFaceIndex:
type: integer
vethIFaceName:
type: string
type: object
type: object
served: true
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Expand Up @@ -65,6 +65,7 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L
github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20200415212048-7901bc822317/go.mod h1:DF8FZRxMHMGv/vP2lQP6h+dYzzjpuRn24VeRiYn3qjQ=
Expand Down Expand Up @@ -248,6 +249,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ=
Expand Down Expand Up @@ -298,6 +300,7 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 h1:yY9rWGoXv1U5pl4gxqlULARMQD7x0QG85lqEXTWysik=
github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
Expand Down Expand Up @@ -1057,6 +1060,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -1425,6 +1429,7 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
inet.af/netaddr v0.0.0-20210313195008-843b4240e319 h1:cSGjHEjS/Nu6pts6yZfSYsRqcfW5ieqSrQI+XcZQObM=
inet.af/netaddr v0.0.0-20210313195008-843b4240e319/go.mod h1:I2i9ONCXRZDnG1+7O8fSuYzjcPxHQXrIfzD/IkR87x4=
Expand Down

0 comments on commit bd9336c

Please sign in to comment.