Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
[5.5] quote environment values if necessary (#429)
Browse files Browse the repository at this point in the history
* Quote environment values if necessary.
* Address review comments
* Bump planet to release
  • Loading branch information
a-palchikov authored Jun 6, 2019
1 parent fcbfa7e commit 6c4f470
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RELEASE_OUT ?=
TELEPORT_TAG = 3.0.5
# TELEPORT_REPOTAG adapts TELEPORT_TAG to the teleport tagging scheme
TELEPORT_REPOTAG := v$(TELEPORT_TAG)
PLANET_TAG := 5.5.17-$(K8S_VER_SUFFIX)
PLANET_TAG := 5.5.18-$(K8S_VER_SUFFIX)
PLANET_BRANCH := $(PLANET_TAG)
K8S_APP_TAG := $(GRAVITY_TAG)
TELEKUBE_APP_TAG := $(GRAVITY_TAG)
Expand Down
3 changes: 2 additions & 1 deletion lib/ops/opsservice/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"net"
"os"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -923,7 +924,7 @@ func (s *site) getPlanetConfig(config planetConfig) (args []string, err error) {
}

for k, v := range config.env {
args = append(args, fmt.Sprintf("--env=%v=%v", k, v))
args = append(args, fmt.Sprintf("--env=%v=%v", k, strconv.Quote(v)))
}

args = append(args, s.addCloudConfig(config.config)...)
Expand Down
3 changes: 2 additions & 1 deletion lib/ops/opsservice/configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (s *ConfigureSuite) TestGeneratesPlanetConfigPackage(c *check.C) {
env: map[string]string{
"VAR": "value",
"VAR2": "value2",
"VAR3": "value1,value2",
},
config: &clusterconfig.Resource{
Kind: storage.KindClusterConfiguration,
Expand Down Expand Up @@ -181,7 +182,7 @@ multizone=true`,
"secrets-dir": {"/var/lib/gravity/secrets"},
"election-enabled": {"true"},
"service-uid": {"1000"},
"env": {"VAR=value", "VAR2=value2"},
"env": {`VAR="value"`, `VAR2="value2"`, `VAR3="value1,value2"`},
"volume": {
"/var/lib/gravity/planet/etcd:/ext/etcd",
"/var/lib/gravity/planet/docker:/ext/docker",
Expand Down
6 changes: 0 additions & 6 deletions lib/update/internal/rollingupdate/phases/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,12 @@ func NewRestart(
return nil, trace.NotFound("no server specified for phase %q",
params.Phase.ID)
}
cluster, err := operator.GetLocalSite()
if err != nil {
return nil, trace.Wrap(err)
}
return &restart{
FieldLogger: logger,
operationID: operationID,
backend: backend,
packages: packages,
localPackages: localPackages,
serviceUser: cluster.ServiceUser,
update: params.Phase.Data.Update.Servers[0],
}, nil
}
Expand Down Expand Up @@ -141,6 +136,5 @@ type restart struct {
packages pack.PackageService
localPackages update.LocalPackageService
update storage.UpdateServer
serviceUser storage.OSUser
operationID string
}

0 comments on commit 6c4f470

Please sign in to comment.