diff --git a/config/disk.go b/config/disk.go index dd3ddf9e..ab54a91e 100644 --- a/config/disk.go +++ b/config/disk.go @@ -1,9 +1,7 @@ package config import ( - "encoding/json" "io/ioutil" - "net" "os" "path" "path/filepath" @@ -127,30 +125,6 @@ func SaveInitCmdline(cmdLineArgs string) { } } -func SaveCNISubnet(subnet, filename string) { - if _, _, err := net.ParseCIDR(subnet); err != nil { - log.Errorf("Failed to parse system-docker subnet from cmdline: %v", err) - } - rBytes, err := ioutil.ReadFile(filename) - if err != nil { - log.Errorf("Failed to read from %s: %v", filename, err) - } - var data map[string]interface{} - if err = json.Unmarshal(rBytes, &data); err != nil { - log.Errorf("Failed to pasre json: %v", err) - } - ipam := data["ipam"].(map[string]interface{}) - ipam["subnet"] = subnet - wBytes, err := json.MarshalIndent(data, "", "\t") - if err != nil { - log.Errorf("Failed to convert to bytes: %v", err) - } - log.Debugf("New cni bridge conf: %s", wBytes) - if err = ioutil.WriteFile(filename, wBytes, 0644); err != nil { - log.Errorf("Failed to write cni bridge file %s: %v", filename, err) - } -} - func CloudConfigDirFiles(dirPrefix string) []string { cloudConfigDir := path.Join(dirPrefix, CloudConfigDir) diff --git a/config/types.go b/config/types.go index 3d144264..6ab92c41 100644 --- a/config/types.go +++ b/config/types.go @@ -47,9 +47,6 @@ const ( MetaDataFile = "/var/lib/rancher/conf/metadata" CloudConfigFile = "/var/lib/rancher/conf/cloud-config.yml" EtcResolvConfFile = "/etc/resolv.conf" - CNIBridgeConfigFile = "/etc/docker/cni/bridge.d/bridge.conf" - - RKPDockerSysBridgeSubnet = "rancher.system_docker.subnet" ) var ( diff --git a/init/init.go b/init/init.go index ac0545c9..0fcf588c 100644 --- a/init/init.go +++ b/init/init.go @@ -14,7 +14,6 @@ import ( "github.com/docker/docker/pkg/mount" "github.com/rancher/os/config" - "github.com/rancher/os/config/cmdline" "github.com/rancher/os/dfs" "github.com/rancher/os/log" "github.com/rancher/os/util" @@ -438,12 +437,6 @@ func RunInit() error { log.FsReady() log.Debugf("WARNING: switchroot and mount OEM2 phases not written to log file") - // update docker-sys bridge setting - if dockerSysSubnet := cmdline.GetCmdline(config.RKPDockerSysBridgeSubnet); dockerSysSubnet != "" { - val := dockerSysSubnet.(string) - config.SaveCNISubnet(val, config.CNIBridgeConfigFile) - } - return cfg, nil }}, config.CfgFuncData{"b2d Env", func(cfg *config.CloudConfig) (*config.CloudConfig, error) {