Merge pull request #859 from flaviostutz/env-sort

Sorting env pair array to avoid creating different CloudFormation templates between calls
This commit is contained in:
Nicolas De loof 2020-11-03 06:34:32 +01:00 committed by GitHub
commit 7018477407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -288,6 +288,13 @@ func createEnvironment(project *types.Project, service types.ServiceConfig) ([]e
Value: value,
})
}
//order env keys for idempotence between calls
//to avoid unnecessary resource recreations on CloudFormation
sort.Slice(pairs, func(i, j int) bool {
return pairs[i].Name < pairs[j].Name
})
return pairs, nil
}