Skip to content

Commit

Permalink
removing dead code from network module
Browse files Browse the repository at this point in the history
  • Loading branch information
alacuku committed Jun 23, 2021
1 parent a4a0da9 commit 21fd083
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 410 deletions.
3 changes: 0 additions & 3 deletions apis/config/v1alpha1/clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ type LiqonetConfig struct {
// The subnet used by the cluster for the services, in CIDR notation
// +kubebuilder:validation:Pattern="^([0-9]{1,3}.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))$"
ServiceCIDR string `json:"serviceCIDR"`
// Set this flag to true if you are using GKE, default value is "false"
// +kubebuilder:default=false
GKEProvider bool `json:"GKEProvider"`
// Set of additional user-defined network pools.
// Default set of network pools is: [192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12]
AdditionalPools []CIDR `json:"additionalPools"`
Expand Down
6 changes: 0 additions & 6 deletions deployments/liqo/crds/config.liqo.io_clusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,6 @@ spec:
liqonetConfig:
description: LiqonetConfig defines the configuration of the Liqo Networking.
properties:
GKEProvider:
default: false
description: Set this flag to true if you are using GKE, default
value is "false"
type: boolean
additionalPools:
description: 'Set of additional user-defined network pools. Default
set of network pools is: [192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12]'
Expand Down Expand Up @@ -351,7 +346,6 @@ spec:
pattern: ^([0-9]{1,3}.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))$
type: string
required:
- GKEProvider
- additionalPools
- podCIDR
- reservedSubnets
Expand Down
2 changes: 0 additions & 2 deletions deployments/liqo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ networkManager:
# you need tell liqo the subnets used in your cluster. E.g if your cluster nodes belong to the 192.168.2.0/24 subnet then
# you should add that subnet to the reservedSubnets. PodCIDR and serviceCIDR used in the local cluster are automatically added to the reserved list.
reservedSubnets: []
# -- Set this field to true if you are deploying liqo in GKE cluster
GKEProvider: false
# -- Set of additional network pools.
# Network pools are used to map a cluster network into another one in order to prevent conflicts.
# Default set of network pools is: [10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12]
Expand Down
4 changes: 3 additions & 1 deletion internal/liqonet/route-operator/symmetricRoutingOperator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"strings"
"sync"

"github.com/liqotech/liqo/pkg/liqonet/utils"

"golang.org/x/sys/unix"
corev1 "k8s.io/api/core/v1"
k8sApiErrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -112,7 +114,7 @@ func (src *SymmetricRoutingController) addRoute(req ctrl.Request, p *corev1.Pod)
if !ok {
return false, fmt.Errorf("ip not set")
}
gwIP := overlay.GetOverlayIP(nodeIP)
gwIP := utils.GetOverlayIP(nodeIP)
dstNet := strings.Join([]string{p.Status.PodIP, "32"}, "/")
added, err := routing.AddRoute(dstNet, gwIP, src.vxlanDev.Link.Attrs().Index, src.routingTableID)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

liqoerrors "github.com/liqotech/liqo/pkg/liqonet/errors"
"github.com/liqotech/liqo/pkg/liqonet/overlay"
"github.com/liqotech/liqo/pkg/liqonet/utils"
)

var (
Expand Down Expand Up @@ -71,7 +71,7 @@ var _ = Describe("SymmetricRoutingOperator", func() {
},
},
}
gw := net.ParseIP(overlay.GetOverlayIP(srcNodeIP))
gw := net.ParseIP(utils.GetOverlayIP(srcNodeIP))
Expect(gw).NotTo(BeNil())
_, dst, err := net.ParseCIDR(srcRouteDst)
Expect(err).To(BeNil())
Expand Down Expand Up @@ -232,7 +232,7 @@ var _ = Describe("SymmetricRoutingOperator", func() {
Expect(err).Should(BeNil())
Expect(len(routes)).Should(BeNumerically("==", 1))
Expect(routes[0].Dst.String()).Should(Equal(dstNet.String()))
Expect(routes[0].Gw.String()).Should(Equal(overlay.GetOverlayIP(srcNodeIP)))
Expect(routes[0].Gw.String()).Should(Equal(utils.GetOverlayIP(srcNodeIP)))
})
})

Expand All @@ -254,7 +254,7 @@ var _ = Describe("SymmetricRoutingOperator", func() {
Expect(err).Should(BeNil())
Expect(len(routes)).Should(BeNumerically("==", 1))
Expect(routes[0].Dst.String()).Should(Equal(srcRouteDst))
Expect(routes[0].Gw.String()).Should(Equal(overlay.GetOverlayIP(srcNodeIP)))
Expect(routes[0].Gw.String()).Should(Equal(utils.GetOverlayIP(srcNodeIP)))

})
})
Expand Down
4 changes: 4 additions & 0 deletions pkg/consts/liqonet.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const (
// VxlanDeviceName name used for the vxlan devices created on each node by the instances
// of liqo-route.
VxlanDeviceName = "liqo.vxlan"
// OverlayNetworkPrefix prefix used for the overlay network.
OverlayNetworkPrefix = "240"
// OverlayNetworkMask size of the overlay network.
OverlayNetworkMask = "/8"
// PodCIDR is a field of the TunnelEndpoint resource.
PodCIDR = "PodCIDR"
// LocalPodCIDR is a field of the TunnelEndpoint resource.
Expand Down
168 changes: 0 additions & 168 deletions pkg/liqonet/overlay/overlay.go

This file was deleted.

0 comments on commit 21fd083

Please sign in to comment.