Skip to content

Commit

Permalink
Merge branch 'dynamicconfigpoc' into atom-38-lib-child
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja committed Apr 10, 2024
2 parents 17e11f3 + 2adfbed commit ba7bf8e
Show file tree
Hide file tree
Showing 7 changed files with 441 additions and 440 deletions.
15 changes: 10 additions & 5 deletions asconfig/as_setconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const (
cmdSetConfigNetwork = "set-config:context=network;" // ConfigNetwork
cmdSetConfigService = "set-config:context=service;" // ConfigService
cmdSetConfigNamespace = "set-config:context=namespace;id=" // ConfigNamespace
cmdSetConfigXDR = "set-config:context=xdr" // ConfigXDR
cmdSetConfigSecurity = "set-config:context=security;" // ConfigSecurity
cmdSetLogging = "log-set:id=" // ConfigLogging
// cmdSetConfigXDR = "set-config:context=xdr" // ConfigXDR
cmdSetConfigSecurity = "set-config:context=security;" // ConfigSecurity
cmdSetLogging = "log-set:id=" // ConfigLogging
)

// convertValueToString converts the value of a config to a string.
Expand Down Expand Up @@ -247,6 +247,7 @@ func createLogSetCmdList(tokens []string, operationValueMap map[OpType][]string,
return cmdList, nil
}

/*
// createSetConfigXDRCmdList creates set-config commands for XDR context.
func createSetConfigXDRCmdList(tokens []string, operationValueMap map[OpType][]string) []string {
cmdList := make([]string, 0, len(operationValueMap))
Expand Down Expand Up @@ -311,6 +312,7 @@ func createSetConfigXDRCmdList(tokens []string, operationValueMap map[OpType][]s
return cmdList
}
*/

// CreateSetConfigCmdList creates set-config commands for given config.
func CreateSetConfigCmdList(configMap DynamicConfigMap, conn deployment.ASConnInterface,
Expand All @@ -337,8 +339,11 @@ func CreateSetConfigCmdList(configMap DynamicConfigMap, conn deployment.ASConnIn
case info.ConfigNamespaceContext:
cmdList = append(cmdList, createSetConfigNamespaceCmdList(tokens, val)...)

case info.ConfigXDRContext:
cmdList = append(cmdList, createSetConfigXDRCmdList(tokens, val)...)
/*
Commenting out XDR context for now because of ordering issues.
case info.ConfigXDRContext:
cmdList = append(cmdList, createSetConfigXDRCmdList(tokens, val)...)
*/

case info.ConfigLoggingContext:
cmds, err := createLogSetCmdList(tokens, val, conn, aerospikePolicy)
Expand Down
2 changes: 1 addition & 1 deletion asconfig/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func validateSlice(baseKey string, val []string) []*ValidationErr {
}

func validateString(baseKey, v string) *ValidationErr {
literals := strings.Split(v, " ")
literals := strings.Fields(v)

switch baseKey {
case keyNodeAddressPorts:
Expand Down
Loading

0 comments on commit ba7bf8e

Please sign in to comment.