mirror of
https://github.com/rancher/os.git
synced 2025-08-01 15:08:47 +00:00
Merge pull request #2093 from SvenDowideit/bootstrap-logging
Make the bootstrap phase logable
This commit is contained in:
commit
af000395b4
@ -7,16 +7,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/codegangsta/cli"
|
|
||||||
|
|
||||||
"github.com/rancher/os/config"
|
"github.com/rancher/os/config"
|
||||||
"github.com/rancher/os/log"
|
"github.com/rancher/os/log"
|
||||||
"github.com/rancher/os/util"
|
"github.com/rancher/os/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func bootstrapAction(c *cli.Context) error {
|
func BootstrapMain() {
|
||||||
log.InitLogger()
|
log.InitLogger()
|
||||||
log.Info("Running cloud-init-save")
|
|
||||||
|
|
||||||
log.Debugf("bootstrapAction")
|
log.Debugf("bootstrapAction")
|
||||||
if err := UdevSettle(); err != nil {
|
if err := UdevSettle(); err != nil {
|
||||||
@ -62,8 +59,6 @@ func bootstrapAction(c *cli.Context) error {
|
|||||||
if err := UdevSettle(); err != nil {
|
if err := UdevSettle(); err != nil {
|
||||||
log.Errorf("Failed to run udev settle: %v", err)
|
log.Errorf("Failed to run udev settle: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func mdadmScan() error {
|
func mdadmScan() error {
|
||||||
|
@ -27,13 +27,6 @@ func Main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.Commands = []cli.Command{
|
app.Commands = []cli.Command{
|
||||||
{
|
|
||||||
Name: "bootstrap",
|
|
||||||
Hidden: true,
|
|
||||||
HideHelp: true,
|
|
||||||
SkipFlagParsing: true,
|
|
||||||
Action: bootstrapAction,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "config",
|
Name: "config",
|
||||||
ShortName: "c",
|
ShortName: "c",
|
||||||
|
1
main.go
1
main.go
@ -33,6 +33,7 @@ var entrypoints = map[string]func(){
|
|||||||
"init": osInit.MainInit,
|
"init": osInit.MainInit,
|
||||||
"netconf": network.Main,
|
"netconf": network.Main,
|
||||||
"recovery": control.AutologinMain,
|
"recovery": control.AutologinMain,
|
||||||
|
"ros-bootstrap": control.BootstrapMain,
|
||||||
"ros-sysinit": sysinit.Main,
|
"ros-sysinit": sysinit.Main,
|
||||||
"system-docker": systemdocker.Main,
|
"system-docker": systemdocker.Main,
|
||||||
"wait-for-docker": wait.Main,
|
"wait-for-docker": wait.Main,
|
||||||
|
@ -21,7 +21,7 @@ rancher:
|
|||||||
bootstrap:
|
bootstrap:
|
||||||
bootstrap:
|
bootstrap:
|
||||||
image: {{.OS_REPO}}/os-bootstrap:{{.VERSION}}{{.SUFFIX}}
|
image: {{.OS_REPO}}/os-bootstrap:{{.VERSION}}{{.SUFFIX}}
|
||||||
command: ros bootstrap
|
command: ros-bootstrap
|
||||||
labels:
|
labels:
|
||||||
io.rancher.os.detach: "false"
|
io.rancher.os.detach: "false"
|
||||||
io.rancher.os.scope: system
|
io.rancher.os.scope: system
|
||||||
@ -33,6 +33,7 @@ rancher:
|
|||||||
- /lib/modules:/lib/modules
|
- /lib/modules:/lib/modules
|
||||||
- /lib/firmware:/lib/firmware
|
- /lib/firmware:/lib/firmware
|
||||||
- /usr/bin/ros:/usr/bin/ros:ro
|
- /usr/bin/ros:/usr/bin/ros:ro
|
||||||
|
- /usr/bin/ros:/usr/bin/ros-bootstrap:ro
|
||||||
- /usr/share/ros:/usr/share/ros:ro
|
- /usr/share/ros:/usr/share/ros:ro
|
||||||
- /var/lib/rancher:/var/lib/rancher:ro
|
- /var/lib/rancher:/var/lib/rancher:ro
|
||||||
- /var/log:/var/log
|
- /var/log:/var/log
|
||||||
|
Loading…
Reference in New Issue
Block a user