Compare commits

...

2 Commits

Author SHA1 Message Date
Roxie Gibson 32b2bf245b
refactor: simplfiy for...range loops
continuous-integration/drone/push Build is passing Details
2021-08-31 16:17:08 +01:00
Roxie Gibson 3b93f893fd
refactor: fix defer and handle error 2021-08-31 16:02:38 +01:00
3 changed files with 6 additions and 5 deletions

View File

@ -46,7 +46,7 @@ var appCheckCommand = &cli.Command{
}
var missing []string
for k, _ := range envSample {
for k := range envSample {
if _, ok := appEnv.Env[k]; !ok {
missing = append(missing, k)
}

View File

@ -111,14 +111,15 @@ var appCpCommand = &cli.Command{
}
} else {
content, _, err := cl.CopyFromContainer(ctx, container.ID, srcPath)
defer content.Close()
if err != nil {
logrus.Fatal(err)
}
fromTarOpts := &archive.TarOptions{NoOverwriteDirNonDir: true, Compression: archive.Gzip}
archive.Untar(content, dstPath, fromTarOpts)
defer content.Close()
if err := archive.Untar(content, dstPath, fromTarOpts); err != nil {
logrus.Fatal(err)
}
}
return nil
},
}

View File

@ -58,7 +58,7 @@ var appSecretGenerateCommand = &cli.Command{
} else {
secretName := c.Args().Get(1)
secretVersion := c.Args().Get(2)
for sec, _ := range secretEnvVars {
for sec := range secretEnvVars {
parsed := secret.ParseSecretEnvVarName(sec)
if secretName == parsed {
secretsToCreate[sec] = secretVersion