Skip to content

Commit

Permalink
Fetch names after paths to finely override parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Dementiev committed Jun 12, 2018
1 parent 2e39c86 commit a2386bb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ssm/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,25 @@ func GetParameters(names, paths []string, expand, strict, recursive bool) (param
localNames = ExpandArgs(names)
localPaths = ExpandArgs(paths)
}
if len(localNames) > 0 {
parametersFromNames, err := getJsonSSMParameters(localNames, strict)
if len(localPaths) > 0 {
parametersFromPaths, err := getJsonSSMParametersByPaths(localPaths, strict, recursive)
if err != nil {
log.WithError(err).WithFields(
log.Fields{"names": localNames},
).Fatal("Can't get parameters by names")
log.Fields{"paths": localPaths},
).Fatal("Can't get parameters by paths")
}
for _, parameter := range parametersFromNames {
for _, parameter := range parametersFromPaths {
parameters = append(parameters, parameter)
}
}
if len(localPaths) > 0 {
parametersFromPaths, err := getJsonSSMParametersByPaths(localPaths, strict, recursive)
if len(localNames) > 0 {
parametersFromNames, err := getJsonSSMParameters(localNames, strict)
if err != nil {
log.WithError(err).WithFields(
log.Fields{"paths": localPaths},
).Fatal("Can't get parameters by paths")
log.Fields{"names": localNames},
).Fatal("Can't get parameters by names")
}
for _, parameter := range parametersFromPaths {
for _, parameter := range parametersFromNames {
parameters = append(parameters, parameter)
}
}
Expand Down

0 comments on commit a2386bb

Please sign in to comment.