mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
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:
commit
7018477407
@ -288,6 +288,13 @@ func createEnvironment(project *types.Project, service types.ServiceConfig) ([]e
|
|||||||
Value: value,
|
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
|
return pairs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user