Skip to content

Commit

Permalink
changed scope of selfHeal param
Browse files Browse the repository at this point in the history
  • Loading branch information
jpappa200 committed Sep 26, 2023
1 parent 8ba713f commit ca799d6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/go-atscfg/remapdotconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const selfHealParam = `no_self_healing`
type LineTemplates map[string]*mustache.Template

var RemapLineTemplates = LineTemplates{}
var selfHeal = true

// This parses but also maintains a cache of parsed templates
func (lts *LineTemplates) parse(templateString string) (*mustache.Template, error) {
Expand Down Expand Up @@ -202,8 +201,9 @@ func MakeRemapDotConfig(
// This sticks the DS parameters in a map.
// remap.config parameters use "<plugin>.pparam" key
// cachekey.config parameters retain the 'cachekey.config' key
func classifyConfigParams(configParams []tc.ParameterV5) map[string][]tc.ParameterV5 {
func classifyConfigParams(configParams []tc.ParameterV5) (map[string][]tc.ParameterV5, bool) {
configParamMap := map[string][]tc.ParameterV5{}
selfHeal := true
for _, param := range configParams {
key := param.ConfigFile
if "remap.config" == key {
Expand All @@ -215,7 +215,7 @@ func classifyConfigParams(configParams []tc.ParameterV5) map[string][]tc.Paramet
}
configParamMap[key] = append(configParamMap[key], param)
}
return configParamMap
return configParamMap, selfHeal
}

// For general <plugin>.pparam parameters
Expand Down Expand Up @@ -393,10 +393,10 @@ func getServerConfigRemapDotConfigForMid(
cachekeyArgs = getQStringIgnoreRemap(atsMajorVersion)
}

selfHeal = true
selfHeal := true
dsConfigParamsMap := map[string][]tc.ParameterV5{}
if nil != ds.ProfileID {
dsConfigParamsMap = classifyConfigParams(profilesConfigParams[*ds.ProfileID])
dsConfigParamsMap, selfHeal = classifyConfigParams(profilesConfigParams[*ds.ProfileID])
}

if len(dsConfigParamsMap) > 0 {
Expand Down Expand Up @@ -676,8 +676,7 @@ func buildEdgeRemapLine(
remapTags.HeaderRewrite = `@plugin=header_rewrite.so @pparam=` + edgeHeaderRewriteConfigFileName(ds.XMLID)
}

selfHeal = true
dsConfigParamsMap := classifyConfigParams(remapConfigParams)
dsConfigParamsMap, selfHeal := classifyConfigParams(remapConfigParams)

if ds.SigningAlgorithm != nil && *ds.SigningAlgorithm != "" {
if *ds.SigningAlgorithm == tc.SigningAlgorithmURLSig {
Expand Down

0 comments on commit ca799d6

Please sign in to comment.