Skip to content

Commit

Permalink
Ensure profile settings are always validated on first use
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Dec 1, 2020
1 parent 7b1a672 commit 30863d9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions profile/profile-layered.go
Expand Up @@ -61,6 +61,7 @@ func NewLayeredProfile(localProfile *Profile) *LayeredProfile {
layers: make([]*Profile, 0, len(localProfile.LinkedProfiles)+1),
LayerIDs: make([]string, 0, len(localProfile.LinkedProfiles)+1),
globalValidityFlag: config.NewValidityFlag(),
RevisionCounter: 1,
securityLevel: &securityLevelVal,
}

Expand Down Expand Up @@ -360,7 +361,7 @@ func (lp *LayeredProfile) wrapSecurityLevelOption(configKey string, globalConfig
}

func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.BoolOption) config.BoolOption {
revCnt := lp.RevisionCounter
var revCnt uint64 = 0
var value bool
var refreshLock sync.Mutex

Expand Down Expand Up @@ -392,7 +393,7 @@ func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.B
}

func (lp *LayeredProfile) wrapIntOption(configKey string, globalConfig config.IntOption) config.IntOption {
revCnt := lp.RevisionCounter
var revCnt uint64 = 0
var value int64
var refreshLock sync.Mutex

Expand Down Expand Up @@ -441,7 +442,7 @@ func (lp *LayeredProfile) GetProfileSource(configKey string) string {
For later:
func (lp *LayeredProfile) wrapStringOption(configKey string, globalConfig config.StringOption) config.StringOption {
revCnt := lp.RevisionCounter
var revCnt uint64 = 0
var value string
var refreshLock sync.Mutex
Expand Down

0 comments on commit 30863d9

Please sign in to comment.