mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
Add cdbg warning for non-debug image
This commit is contained in:
parent
5d87b48769
commit
c37fab0a4c
@ -66,6 +66,10 @@ func deploy(cmd *cobra.Command, fileHandler file.Handler, constellationConfig *c
|
||||
debugConfig.ConstellationDebugConfig.BootstrapperPath = overrideBootstrapperPath
|
||||
}
|
||||
|
||||
if !state.ImageNameContainsDebug(constellationConfig) {
|
||||
log.Println("WARN: constellation image does not contain 'debug', are you using a debug image?")
|
||||
}
|
||||
|
||||
overrideIPs, err := cmd.Flags().GetStringSlice("ips")
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -2,6 +2,7 @@ package state
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/edgelesssys/constellation/internal/cloud/cloudtypes"
|
||||
"github.com/edgelesssys/constellation/internal/config"
|
||||
@ -76,3 +77,15 @@ func getQEMUInstances(stat state.ConstellationState, _ *config.Config) (controlP
|
||||
workers = cloudtypes.ScalingGroup{Instances: stat.QEMUWorkers}
|
||||
return
|
||||
}
|
||||
|
||||
// ImageNameContainsDebug check wether the image name in config contains "debug".
|
||||
func ImageNameContainsDebug(config *config.Config) bool {
|
||||
switch {
|
||||
case config.Provider.GCP != nil:
|
||||
return strings.Contains(config.Provider.GCP.Image, "debug")
|
||||
case config.Provider.Azure != nil:
|
||||
return strings.Contains(config.Provider.Azure.Image, "debug")
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user