Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort stack envvars before deploying stack services #1079

Merged
merged 1 commit into from
Oct 7, 2020
Merged

Sort stack envvars before deploying stack services #1079

merged 1 commit into from
Oct 7, 2020

Conversation

pchico83
Copy link
Contributor

@pchico83 pchico83 commented Oct 6, 2020

Signed-off-by: Pablo Chico de Guzman pchico83@gmail.com

Proposed changes

  • Kubernetes redeploys pods if envvars have a different order

Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@64ddea1). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1079   +/-   ##
=========================================
  Coverage          ?   35.01%           
=========================================
  Files             ?       62           
  Lines             ?     5207           
  Branches          ?        0           
=========================================
  Hits              ?     1823           
  Misses            ?     3194           
  Partials          ?      190           
Impacted Files Coverage Δ
pkg/cmd/stack/translate.go 30.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64ddea1...ee41d0e. Read the comment docs.

@@ -58,6 +60,9 @@ func translateEnvVars(s *model.Stack) error {
for _, envFilepath := range svc.EnvFiles {
translateEnvFile(&svc, envFilepath)
}
sort.SliceStable(svc.Environment, func(i, j int) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to do this? To make it easier to read?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kubernetes redeploys pods if envvars have a different order. This is very inconvenient with stefulsets, for example. If my stack yaml does change, it shouldn't be expected that pods are redeployed

@pchico83 pchico83 merged commit bda9ae0 into master Oct 7, 2020
@pchico83 pchico83 deleted the sort branch October 7, 2020 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants