Skip to content

Commit

Permalink
feat(cable-driver): 🚀 select cable driver for submariner
Browse files Browse the repository at this point in the history
  • Loading branch information
tunahanertekin authored Mar 14, 2024
2 parents 453cb35 + e9d1c4a commit 61b91a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions api/v1alpha1/submarineroperator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ type SubmarinerOperatorSpec struct {
HelmRepository HelmRepository `json:"helmRepository"`
// +kubebuilder:validation:Required
HelmChart HelmChart `json:"helmChart"`
// +kubebuilder:validation:Required
// +kubebuilder:validation:Enum=libreswan;wireguard
// +kubebuilder:default="libreswan"
CableDriver string `json:"cableDriver"`
}

type SubmarinerOperatorPhase string
Expand Down
10 changes: 5 additions & 5 deletions controllers/pkg/helm/submariner_operator_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func getSubmarinerDefault() Submariner {
ServiceCIDR: "",
NatEnabled: true,
ServiceDiscovery: true,
CableDriver: "libreswan",
CableDriver: "libreswan", // or wireguard
HealthCheckEnabled: true,
// GlobalCIDR: "",
// not a safe way to indicate CoreDNS
Expand All @@ -43,8 +43,8 @@ type Broker struct {
Server string `yaml:"server"`
Token string `yaml:"token"`
Namespace string `yaml:"namespace"`
// Insecure bool `yaml:"insecure"`
Ca string `yaml:"ca"`
Insecure bool `yaml:"insecure"`
Ca string `yaml:"ca"`
// GlobalNet string `yaml:"globalnet"`
}

Expand Down Expand Up @@ -123,9 +123,9 @@ func GetSubmarinerOperatorValues(submarinerOperator connectionhubv1alpha1.Submar
valuesObj.Broker.Server = submarinerOperator.Spec.APIServerURL
valuesObj.Broker.Token = submarinerOperator.Spec.BrokerCredentials.Token
valuesObj.Broker.Ca = submarinerOperator.Spec.BrokerCredentials.CA
// valuesObj.Broker.Insecure = true
valuesObj.Broker.Insecure = true
valuesObj.Submariner.ServiceDiscovery = true
valuesObj.Submariner.CableDriver = "libreswan"
valuesObj.Submariner.CableDriver = submarinerOperator.Spec.CableDriver
valuesObj.Submariner.ClusterID = submarinerOperator.Spec.ClusterID
valuesObj.Submariner.NatEnabled = submarinerOperator.Spec.NetworkType == connectionhubv1alpha1.NetworkTypeExternal
valuesObj.ServiceAccounts.LighthouseAgent.Create = true
Expand Down

0 comments on commit 61b91a6

Please sign in to comment.