Commit 8dcdc43 1 parent 95c658a commit 8dcdc43 Copy full SHA for 8dcdc43
File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,13 @@ func unmarshalConfig(logger *logrus.Entry) lib.MHConfigFile {
50
50
if err := viper .Unmarshal (& mhConfigFile ); err != nil {
51
51
logger .WithField ("error" , err ).Fatal ("Failed to unmarshal mh configuration file" )
52
52
}
53
+
54
+ // Check top-level targetContext for backwards compatibility
55
+ if mhConfigFile .TargetContext != "" {
56
+ logger .Warn ("Top-level configuration is deprecated, move to the 'mh' key" )
57
+ mhConfigFile .MH .TargetContext = mhConfigFile .TargetContext
58
+ }
59
+
53
60
logger = logger .WithField ("configFile" , viper .ConfigFileUsed ())
54
61
55
62
return mhConfigFile
Original file line number Diff line number Diff line change @@ -22,9 +22,11 @@ import (
22
22
23
23
// MHConfigFile is the structure of a mh configuration file.
24
24
type MHConfigFile struct {
25
- MH MHConfig `yaml:"mh"`
26
- Apps AppConfigs `yaml:"apps"`
27
- AppSources AppSourceConfigs `yaml:"appSources"`
25
+ // TargetContext for backwards compatibility
26
+ TargetContext string `yaml:"targetContext"`
27
+ MH MHConfig `yaml:"mh"`
28
+ Apps AppConfigs `yaml:"apps"`
29
+ AppSources AppSourceConfigs `yaml:"appSources"`
28
30
}
29
31
30
32
// EffectiveApps returns all Apps that are configured in a MHConfigFile,
You can’t perform that action at this time.
0 commit comments