mirror of
https://github.com/kairos-io/immucore.git
synced 2025-09-03 22:26:12 +00:00
Do not do anything if rd.cos.disable its on the cmdline
That means we dont want to run any immutable stuff, for netboot and cdrom Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
@@ -39,7 +39,13 @@ Sends a generic event payload with the configuration found in the scanned direct
|
||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||
}
|
||||
|
||||
// First set the sentinel file
|
||||
// You can pass rd.cos.disable in the cmdline to disable the whole immutable stuff
|
||||
if len(utils.ReadCMDLineArg("rd.cos.disable")) > 0 {
|
||||
log.Logger.Info().Msg("Stanza rd.cos.disable on the cmdline. Doing nothing.")
|
||||
return nil
|
||||
}
|
||||
|
||||
// First set the sentinel file.
|
||||
if !c.Bool("dry-run") {
|
||||
err = utils.SetSentinelFile()
|
||||
if err != nil {
|
||||
@@ -48,8 +54,7 @@ Sends a generic event payload with the configuration found in the scanned direct
|
||||
}
|
||||
}
|
||||
|
||||
// If we boot from CD, we do nothing
|
||||
cdBoot, err := utils.BootedFromCD()
|
||||
cdBoot, err := utils.BootedFromLiveMedia()
|
||||
if err != nil {
|
||||
log.Logger.Err(err).Send()
|
||||
return err
|
||||
@@ -57,6 +62,7 @@ Sends a generic event payload with the configuration found in the scanned direct
|
||||
|
||||
img := utils.ReadCMDLineArg("cos-img/filename=")
|
||||
if len(img) == 0 {
|
||||
// If we boot from LIVE media or are using dry-run, we use a fake img as we still want to do things
|
||||
if c.Bool("dry-run") || cdBoot {
|
||||
img = []string{"fake"}
|
||||
} else {
|
||||
|
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// BootedFromCD tells us if we are currently runnig of the LiveCD
|
||||
func BootedFromCD() (bool, error) {
|
||||
// BootedFromLiveMedia tells us if we are currently running off LIVE media like cd/usb or netboot
|
||||
func BootedFromLiveMedia() (bool, error) {
|
||||
runtime, err := state.NewRuntime()
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
Reference in New Issue
Block a user