Ensure profile settings are always validated on first use
This commit is contained in:
@@ -61,6 +61,7 @@ func NewLayeredProfile(localProfile *Profile) *LayeredProfile {
|
|||||||
layers: make([]*Profile, 0, len(localProfile.LinkedProfiles)+1),
|
layers: make([]*Profile, 0, len(localProfile.LinkedProfiles)+1),
|
||||||
LayerIDs: make([]string, 0, len(localProfile.LinkedProfiles)+1),
|
LayerIDs: make([]string, 0, len(localProfile.LinkedProfiles)+1),
|
||||||
globalValidityFlag: config.NewValidityFlag(),
|
globalValidityFlag: config.NewValidityFlag(),
|
||||||
|
RevisionCounter: 1,
|
||||||
securityLevel: &securityLevelVal,
|
securityLevel: &securityLevelVal,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,7 +361,7 @@ func (lp *LayeredProfile) wrapSecurityLevelOption(configKey string, globalConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.BoolOption) config.BoolOption {
|
func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.BoolOption) config.BoolOption {
|
||||||
revCnt := lp.RevisionCounter
|
var revCnt uint64 = 0
|
||||||
var value bool
|
var value bool
|
||||||
var refreshLock sync.Mutex
|
var refreshLock sync.Mutex
|
||||||
|
|
||||||
@@ -392,7 +393,7 @@ func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.B
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (lp *LayeredProfile) wrapIntOption(configKey string, globalConfig config.IntOption) config.IntOption {
|
func (lp *LayeredProfile) wrapIntOption(configKey string, globalConfig config.IntOption) config.IntOption {
|
||||||
revCnt := lp.RevisionCounter
|
var revCnt uint64 = 0
|
||||||
var value int64
|
var value int64
|
||||||
var refreshLock sync.Mutex
|
var refreshLock sync.Mutex
|
||||||
|
|
||||||
@@ -441,7 +442,7 @@ func (lp *LayeredProfile) GetProfileSource(configKey string) string {
|
|||||||
For later:
|
For later:
|
||||||
|
|
||||||
func (lp *LayeredProfile) wrapStringOption(configKey string, globalConfig config.StringOption) config.StringOption {
|
func (lp *LayeredProfile) wrapStringOption(configKey string, globalConfig config.StringOption) config.StringOption {
|
||||||
revCnt := lp.RevisionCounter
|
var revCnt uint64 = 0
|
||||||
var value string
|
var value string
|
||||||
var refreshLock sync.Mutex
|
var refreshLock sync.Mutex
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user