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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user