1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

Rewrite a few scripts in Go and remove unneeded services

This commit is contained in:
Josh Curl
2016-10-17 14:47:44 -07:00
parent 9755a37fe6
commit a7d405991c
22 changed files with 321 additions and 226 deletions

View File

@@ -9,11 +9,16 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/docker/libcompose/project/options"
"github.com/rancher/os/cmd/control"
"github.com/rancher/os/compose"
"github.com/rancher/os/config"
"github.com/rancher/os/docker"
)
const (
systemImagesPreloadDirectory = "/var/lib/rancher/preload/system-docker"
)
func hasImage(name string) bool {
stamp := path.Join(STATE, name)
if _, err := os.Stat(stamp); os.IsNotExist(err) {
@@ -91,6 +96,10 @@ func loadImages(cfg *config.CloudConfig) (*config.CloudConfig, error) {
func SysInit() error {
cfg := config.LoadConfig()
if err := control.PreloadImages(docker.NewSystemClient, systemImagesPreloadDirectory); err != nil {
log.Errorf("Failed to preload System Docker images: %v", err)
}
_, err := config.ChainCfgFuncs(cfg,
loadImages,
func(cfg *config.CloudConfig) (*config.CloudConfig, error) {