Skip to content

Commit

Permalink
feat(develop): fix ipip param not set false (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu authored Jul 31, 2021
1 parent 33e0596 commit a9a99a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func init() {

initCmd.Flags().BoolVar(&install.WithoutCNI, "without-cni", false, "If true we not install cni plugin")
initCmd.Flags().StringVar(&install.Network, "network", "calico", "cni plugin, calico..")
initCmd.Flags().BoolVar(&install.IPIP, "ipip", true, "ipip mode enable, calico..")
initCmd.Flags().BoolVar(&install.BGP, "bgp", false, "bgp mode enable, calico..")
initCmd.Flags().StringVar(&install.MTU, "mtu", "1440", "mtu of the ipip mode , calico..")
initCmd.Flags().StringVar(&install.LvscareImage.Image, "lvscare-image", "fanux/lvscare", "lvscare image name")
initCmd.Flags().StringVar(&install.LvscareImage.Tag, "lvscare-tag", "latest", "lvscare image tag name")
Expand Down
8 changes: 3 additions & 5 deletions install/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,10 @@ func (s *SealosInstaller) InstallMaster0() {
Interface = "interface=" + Interface
}


var cniVersion string
if SSHConfig.IsFileExist(s.Masters[0], "/root/kube/Metadata") {
var metajson string
var tmpdata metadata
var tmpdata metadata
metajson = SSHConfig.CmdToString(s.Masters[0], "cat /root/kube/Metadata", "")
err := json.Unmarshal([]byte(metajson), &tmpdata)
if err != nil {
Expand All @@ -206,16 +205,15 @@ func (s *SealosInstaller) InstallMaster0() {
Network = tmpdata.CniName
}
}


netyaml := net.NewNetwork(Network, net.MetaData{
Interface: Interface,
CIDR: PodCIDR,
IPIP: IPIP,
IPIP: !BGP,
MTU: MTU,
CniRepo: Repo,
K8sServiceHost: s.ApiServer,
Version: cniVersion,
Version: cniVersion,
}).Manifests("")

cmd = fmt.Sprintf(`echo '%s' | kubectl apply -f -`, netyaml)
Expand Down
2 changes: 1 addition & 1 deletion install/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
//network interface name, like "eth.*|en.*"
Interface string
// the ipip mode of the calico
IPIP bool
BGP bool
// mtu size
MTU string

Expand Down

0 comments on commit a9a99a5

Please sign in to comment.