mirror of
https://github.com/rancher/os.git
synced 2025-07-30 22:24:33 +00:00
Merge pull request #1031 from joshwget/remove-rkt-support
Remove rkt support
This commit is contained in:
commit
eb0c262ef7
@ -30,16 +30,6 @@ setup_ssh()
|
||||
mkdir -p /var/run/sshd
|
||||
}
|
||||
|
||||
setup_cgroup()
|
||||
{
|
||||
local cgroup=$(grep name=systemd /proc/$$/cgroup | cut -f3 -d:)
|
||||
if [ -n "$cgroup" ]; then
|
||||
mkdir -p /sys/fs/cgroup/systemd${cgroup}
|
||||
fi
|
||||
}
|
||||
|
||||
setup_cgroup || true
|
||||
|
||||
RANCHER_HOME=/home/rancher
|
||||
if [ ! -d ${RANCHER_HOME} ]; then
|
||||
mkdir -p ${RANCHER_HOME}
|
||||
|
@ -166,7 +166,6 @@ func getLaunchConfig(cfg *config.CloudConfig, dockerCfg *config.DockerConfig) (*
|
||||
launchConfig.DnsConfig.Nameservers = cfg.Rancher.Defaults.Network.Dns.Nameservers
|
||||
launchConfig.DnsConfig.Search = cfg.Rancher.Defaults.Network.Dns.Search
|
||||
launchConfig.Environment = dockerCfg.Environment
|
||||
launchConfig.EmulateSystemd = true
|
||||
|
||||
if !cfg.Rancher.Debug {
|
||||
launchConfig.LogFile = config.SYSTEM_DOCKER_LOG
|
||||
|
@ -190,7 +190,6 @@ rancher:
|
||||
read_only: true
|
||||
volumes:
|
||||
- /var/lib/docker:/var/lib/docker
|
||||
- /var/lib/rkt:/var/lib/rkt
|
||||
network-pre:
|
||||
image: {{.OS_REPO}}/os-base:{{.VERSION}}{{.SUFFIX}}
|
||||
command: netconf
|
||||
@ -280,7 +279,6 @@ rancher:
|
||||
- /etc/docker:/etc/docker
|
||||
- /etc/hosts:/etc/hosts
|
||||
- /etc/resolv.conf:/etc/resolv.conf
|
||||
- /etc/rkt:/etc/rkt
|
||||
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt.rancher
|
||||
- /etc/selinux:/etc/selinux
|
||||
- /lib/firmware:/lib/firmware
|
||||
|
@ -33,7 +33,7 @@ github.com/opencontainers/runtime-spec f955d90e70a98ddfb886bd930ffd076da9b67998
|
||||
github.com/opencontainers/specs f955d90e70a98ddfb886bd930ffd076da9b67998
|
||||
github.com/packethost/packngo 92012705236896736875186c9e49557897c6af90 https://github.com/ibuildthecloud/packngo.git
|
||||
github.com/pmezard/go-difflib d8ed2627bdf02c080bf22230dbb337003b7aba2d
|
||||
github.com/rancher/docker-from-scratch 2f55d849ff39f4b05be0d4f0d1d603024d4a768b
|
||||
github.com/rancher/docker-from-scratch 24857c88a000ef5e7f9f5f17fa848d695f698239
|
||||
github.com/rancher/netconf ddd7e35a6aacd7e80991920774083dd4408ec018
|
||||
github.com/rcrowley/go-metrics eeba7bd0dd01ace6e690fa833b3f22aaec29af43
|
||||
github.com/ryanuber/go-glob 0067a9abd927e50aed5190662702f81231413ae0
|
||||
|
35
vendor/github.com/rancher/docker-from-scratch/scratch.go
generated
vendored
35
vendor/github.com/rancher/docker-from-scratch/scratch.go
generated
vendored
@ -2,7 +2,6 @@ package dockerlaunch
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@ -23,7 +22,6 @@ const (
|
||||
defaultPrefix = "/usr"
|
||||
iptables = "/sbin/iptables"
|
||||
modprobe = "/sbin/modprobe"
|
||||
systemdRoot = "/sys/fs/cgroup/systemd/user.slice"
|
||||
distSuffix = ".dist"
|
||||
)
|
||||
|
||||
@ -41,9 +39,6 @@ var (
|
||||
optionalMounts = [][]string{
|
||||
{"none", "/sys/fs/selinux", "selinuxfs", ""},
|
||||
}
|
||||
systemdMounts = [][]string{
|
||||
{"systemd", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd"},
|
||||
}
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@ -57,7 +52,6 @@ type Config struct {
|
||||
CgroupHierarchy map[string]string
|
||||
LogFile string
|
||||
NoLog bool
|
||||
EmulateSystemd bool
|
||||
NoFiles uint64
|
||||
Environment []string
|
||||
GraphDirectory string
|
||||
@ -572,40 +566,11 @@ func secondPrepare(config *Config, docker string, args ...string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := setupSystemd(config); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ioutil.WriteFile("/proc/sys/net/ipv4/ip_forward", []byte("1"), 0655)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func setupSystemd(config *Config) error {
|
||||
if !config.EmulateSystemd {
|
||||
return nil
|
||||
}
|
||||
|
||||
cgroups, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/cgroup", os.Getpid()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if strings.Contains(string(cgroups), "name=systemd") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := createMounts(systemdMounts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := os.Mkdir(systemdRoot, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return ioutil.WriteFile(path.Join(systemdRoot, "cgroup.procs"), []byte(strconv.Itoa(os.Getpid())+"\n"), 0644)
|
||||
}
|
||||
|
||||
func expand(bin string) string {
|
||||
expanded, err := exec.LookPath(bin)
|
||||
if err == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user