Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ijaz Ahmad
ksonnet
Commits
c6b1d85c
Unverified
Commit
c6b1d85c
authored
Apr 10, 2018
by
Bryan Liles
Committed by
GitHub
Apr 10, 2018
Browse files
Merge pull request #433 from bryanl/action-option-tests
Action option tests
parents
5127e0ca
a8222540
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
285 additions
and
115 deletions
+285
-115
actions/actions.go
actions/actions.go
+11
-11
actions/actions_test.go
actions/actions_test.go
+209
-39
actions/apply.go
actions/apply.go
+7
-7
actions/component_list.go
actions/component_list.go
+3
-3
actions/component_rm.go
actions/component_rm.go
+2
-2
actions/current_environment.go
actions/current_environment.go
+1
-1
actions/delete.go
actions/delete.go
+4
-4
actions/env_add.go
actions/env_add.go
+6
-6
actions/env_current.go
actions/env_current.go
+3
-3
actions/env_describe.go
actions/env_describe.go
+2
-2
actions/env_list.go
actions/env_list.go
+2
-2
actions/env_rm.go
actions/env_rm.go
+3
-3
actions/env_set.go
actions/env_set.go
+4
-4
actions/env_targets.go
actions/env_targets.go
+3
-3
actions/import.go
actions/import.go
+3
-3
actions/init.go
actions/init.go
+8
-8
actions/module_create.go
actions/module_create.go
+2
-2
actions/module_list.go
actions/module_list.go
+2
-2
actions/param_delete.go
actions/param_delete.go
+6
-6
actions/param_list.go
actions/param_list.go
+4
-4
No files found.
actions/actions.go
View file @
c6b1d85c
...
@@ -148,7 +148,7 @@ func newOptionLoader(m map[string]interface{}) *optionLoader {
...
@@ -148,7 +148,7 @@ func newOptionLoader(m map[string]interface{}) *optionLoader {
}
}
}
}
func
(
o
*
optionLoader
)
l
oadFs
(
name
string
)
afero
.
Fs
{
func
(
o
*
optionLoader
)
L
oadFs
(
name
string
)
afero
.
Fs
{
i
:=
o
.
load
(
name
)
i
:=
o
.
load
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
nil
return
nil
...
@@ -163,7 +163,7 @@ func (o *optionLoader) loadFs(name string) afero.Fs {
...
@@ -163,7 +163,7 @@ func (o *optionLoader) loadFs(name string) afero.Fs {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadBool
(
name
string
)
bool
{
func
(
o
*
optionLoader
)
L
oadBool
(
name
string
)
bool
{
i
:=
o
.
load
(
name
)
i
:=
o
.
load
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
false
return
false
...
@@ -178,7 +178,7 @@ func (o *optionLoader) loadBool(name string) bool {
...
@@ -178,7 +178,7 @@ func (o *optionLoader) loadBool(name string) bool {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadOptionalBool
(
name
string
)
bool
{
func
(
o
*
optionLoader
)
L
oadOptionalBool
(
name
string
)
bool
{
i
:=
o
.
loadOptional
(
name
)
i
:=
o
.
loadOptional
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
false
return
false
...
@@ -192,7 +192,7 @@ func (o *optionLoader) loadOptionalBool(name string) bool {
...
@@ -192,7 +192,7 @@ func (o *optionLoader) loadOptionalBool(name string) bool {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadInt
(
name
string
)
int
{
func
(
o
*
optionLoader
)
L
oadInt
(
name
string
)
int
{
i
:=
o
.
load
(
name
)
i
:=
o
.
load
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
0
return
0
...
@@ -207,7 +207,7 @@ func (o *optionLoader) loadInt(name string) int {
...
@@ -207,7 +207,7 @@ func (o *optionLoader) loadInt(name string) int {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadInt64
(
name
string
)
int64
{
func
(
o
*
optionLoader
)
L
oadInt64
(
name
string
)
int64
{
i
:=
o
.
load
(
name
)
i
:=
o
.
load
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
0
return
0
...
@@ -222,7 +222,7 @@ func (o *optionLoader) loadInt64(name string) int64 {
...
@@ -222,7 +222,7 @@ func (o *optionLoader) loadInt64(name string) int64 {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadOptionalInt
(
name
string
)
int
{
func
(
o
*
optionLoader
)
L
oadOptionalInt
(
name
string
)
int
{
i
:=
o
.
loadOptional
(
name
)
i
:=
o
.
loadOptional
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
0
return
0
...
@@ -236,7 +236,7 @@ func (o *optionLoader) loadOptionalInt(name string) int {
...
@@ -236,7 +236,7 @@ func (o *optionLoader) loadOptionalInt(name string) int {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadString
(
name
string
)
string
{
func
(
o
*
optionLoader
)
L
oadString
(
name
string
)
string
{
i
:=
o
.
load
(
name
)
i
:=
o
.
load
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
""
return
""
...
@@ -251,7 +251,7 @@ func (o *optionLoader) loadString(name string) string {
...
@@ -251,7 +251,7 @@ func (o *optionLoader) loadString(name string) string {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadOptionalString
(
name
string
)
string
{
func
(
o
*
optionLoader
)
L
oadOptionalString
(
name
string
)
string
{
i
:=
o
.
loadOptional
(
name
)
i
:=
o
.
loadOptional
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
""
return
""
...
@@ -265,7 +265,7 @@ func (o *optionLoader) loadOptionalString(name string) string {
...
@@ -265,7 +265,7 @@ func (o *optionLoader) loadOptionalString(name string) string {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadStringSlice
(
name
string
)
[]
string
{
func
(
o
*
optionLoader
)
L
oadStringSlice
(
name
string
)
[]
string
{
i
:=
o
.
load
(
name
)
i
:=
o
.
load
(
name
)
if
i
==
nil
{
if
i
==
nil
{
return
nil
return
nil
...
@@ -280,7 +280,7 @@ func (o *optionLoader) loadStringSlice(name string) []string {
...
@@ -280,7 +280,7 @@ func (o *optionLoader) loadStringSlice(name string) []string {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadClientConfig
()
*
client
.
Config
{
func
(
o
*
optionLoader
)
L
oadClientConfig
()
*
client
.
Config
{
i
:=
o
.
load
(
OptionClientConfig
)
i
:=
o
.
load
(
OptionClientConfig
)
if
i
==
nil
{
if
i
==
nil
{
return
nil
return
nil
...
@@ -295,7 +295,7 @@ func (o *optionLoader) loadClientConfig() *client.Config {
...
@@ -295,7 +295,7 @@ func (o *optionLoader) loadClientConfig() *client.Config {
return
a
return
a
}
}
func
(
o
*
optionLoader
)
l
oadApp
()
app
.
App
{
func
(
o
*
optionLoader
)
L
oadApp
()
app
.
App
{
i
:=
o
.
load
(
OptionApp
)
i
:=
o
.
load
(
OptionApp
)
if
i
==
nil
{
if
i
==
nil
{
o
.
err
=
ErrNotInApp
o
.
err
=
ErrNotInApp
...
...
actions/actions_test.go
View file @
c6b1d85c
...
@@ -16,57 +16,227 @@
...
@@ -16,57 +16,227 @@
package
actions
package
actions
import
(
import
(
"fmt"
"io/ioutil"
"io/ioutil"
"path/filepath"
"path/filepath"
"reflect"
"testing"
"testing"
"github.com/ksonnet/ksonnet/client"
cmocks
"github.com/ksonnet/ksonnet/component/mocks"
cmocks
"github.com/ksonnet/ksonnet/component/mocks"
"github.com/ksonnet/ksonnet/metadata/app/mocks"
"github.com/ksonnet/ksonnet/metadata/app/mocks"
"github.com/ksonnet/ksonnet/pkg/registry"
"github.com/ksonnet/ksonnet/pkg/registry"
rmocks
"github.com/ksonnet/ksonnet/pkg/registry/mocks"
rmocks
"github.com/ksonnet/ksonnet/pkg/registry/mocks"
"github.com/pkg/errors"
"github.com/spf13/afero"
"github.com/spf13/afero"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
func
Test_optionsLoader_loadApp
(
t
*
testing
.
T
)
{
func
Test_optionLoader_types
(
t
*
testing
.
T
)
{
withApp
(
t
,
func
(
a
*
mocks
.
App
)
{
cases
:=
[]
struct
{
cases
:=
[]
struct
{
name
string
name
string
hasArg
bool
m
map
[
string
]
interface
{}
valid
interface
{}
isErr
bool
invalid
interface
{}
}{
keyName
string
{
}{
name
:
"with app"
,
{
m
:
map
[
string
]
interface
{}{
name
:
"App"
,
OptionApp
:
a
,
valid
:
&
mocks
.
App
{},
},
invalid
:
"invalid"
,
},
keyName
:
OptionApp
,
{
},
name
:
"with invalid app"
,
{
m
:
map
[
string
]
interface
{}{
name
:
"Bool"
,
OptionApp
:
"invalid"
,
hasArg
:
true
,
},
valid
:
true
,
isErr
:
true
,
invalid
:
"invalid"
,
},
keyName
:
OptionSkipGc
,
}
},
{
for
_
,
tc
:=
range
cases
{
name
:
"Fs"
,
t
.
Run
(
tc
.
name
,
func
(
t
*
testing
.
T
)
{
hasArg
:
true
,
ol
:=
newOptionLoader
(
tc
.
m
)
valid
:
afero
.
NewMemMapFs
(),
invalid
:
"invalid"
,
got
:=
ol
.
loadApp
()
keyName
:
OptionFs
,
if
tc
.
isErr
{
},
require
.
Error
(
t
,
ol
.
err
)
{
return
name
:
"Int"
,
}
hasArg
:
true
,
valid
:
0
,
require
.
NoError
(
t
,
ol
.
err
)
invalid
:
"invalid"
,
assert
.
Equal
(
t
,
a
,
got
)
keyName
:
OptionName
,
})
},
}
{
name
:
"Int64"
,
})
hasArg
:
true
,
valid
:
int64
(
0
),
invalid
:
"invalid"
,
keyName
:
OptionName
,
},
{
name
:
"String"
,
hasArg
:
true
,
valid
:
"valid"
,
invalid
:
0
,
keyName
:
OptionName
,
},
{
name
:
"StringSlice"
,
hasArg
:
true
,
valid
:
[]
string
{},
invalid
:
"invalid"
,
keyName
:
OptionName
,
},
{
name
:
"ClientConfig"
,
valid
:
&
client
.
Config
{},
invalid
:
"invalid"
,
keyName
:
OptionClientConfig
,
},
}
for
_
,
tc
:=
range
cases
{
methodName
:=
fmt
.
Sprintf
(
"Load%s"
,
tc
.
name
)
t
.
Run
(
tc
.
name
+
" valid"
,
func
(
t
*
testing
.
T
)
{
m
:=
map
[
string
]
interface
{}{
tc
.
keyName
:
tc
.
valid
,
}
ol
:=
newOptionLoader
(
m
)
loader
:=
reflect
.
ValueOf
(
ol
)
.
MethodByName
(
methodName
)
callValues
:=
make
([]
reflect
.
Value
,
0
)
if
tc
.
hasArg
{
callValues
=
append
(
callValues
,
reflect
.
ValueOf
(
tc
.
keyName
))
}
values
:=
loader
.
Call
(
callValues
)
require
.
Len
(
t
,
values
,
1
)
require
.
EqualValues
(
t
,
tc
.
valid
,
values
[
0
]
.
Interface
())
})
t
.
Run
(
tc
.
name
+
" invalid"
,
func
(
t
*
testing
.
T
)
{
m
:=
map
[
string
]
interface
{}{
tc
.
keyName
:
tc
.
invalid
,
}
ol
:=
newOptionLoader
(
m
)
loader
:=
reflect
.
ValueOf
(
ol
)
.
MethodByName
(
methodName
)
callValues
:=
make
([]
reflect
.
Value
,
0
)
if
tc
.
hasArg
{
callValues
=
append
(
callValues
,
reflect
.
ValueOf
(
tc
.
keyName
))
}
loader
.
Call
(
callValues
)
require
.
Error
(
t
,
ol
.
err
)
})
t
.
Run
(
tc
.
name
+
" previous error"
,
func
(
t
*
testing
.
T
)
{
m
:=
map
[
string
]
interface
{}{
tc
.
keyName
:
tc
.
invalid
,
}
ol
:=
newOptionLoader
(
m
)
ol
.
err
=
errors
.
New
(
"error"
)
loader
:=
reflect
.
ValueOf
(
ol
)
.
MethodByName
(
methodName
)
callValues
:=
make
([]
reflect
.
Value
,
0
)
if
tc
.
hasArg
{
callValues
=
append
(
callValues
,
reflect
.
ValueOf
(
tc
.
keyName
))
}
loader
.
Call
(
callValues
)
require
.
Error
(
t
,
ol
.
err
)
})
}
}
func
Test_optionLoader_optional_types
(
t
*
testing
.
T
)
{
cases
:=
[]
struct
{
name
string
valid
interface
{}
invalid
interface
{}
expected
interface
{}
keyName
string
}{
{
name
:
"Bool"
,
valid
:
true
,
invalid
:
"invalid"
,
expected
:
false
,
keyName
:
OptionApp
,
},
{
name
:
"Int"
,
valid
:
9
,
invalid
:
"invalid"
,
expected
:
0
,
keyName
:
OptionApp
,
},
{
name
:
"String"
,
valid
:
"valid"
,
invalid
:
9
,
expected
:
""
,
keyName
:
OptionApp
,
},
}
for
_
,
tc
:=
range
cases
{
methodName
:=
fmt
.
Sprintf
(
"LoadOptional%s"
,
tc
.
name
)
t
.
Run
(
tc
.
name
+
" valid"
,
func
(
t
*
testing
.
T
)
{
m
:=
map
[
string
]
interface
{}{
tc
.
keyName
:
tc
.
valid
,
}
ol
:=
newOptionLoader
(
m
)
loader
:=
reflect
.
ValueOf
(
ol
)
.
MethodByName
(
methodName
)
callValues
:=
[]
reflect
.
Value
{
reflect
.
ValueOf
(
tc
.
keyName
)}
values
:=
loader
.
Call
(
callValues
)
require
.
Len
(
t
,
values
,
1
)
require
.
EqualValues
(
t
,
tc
.
valid
,
values
[
0
]
.
Interface
())
})
t
.
Run
(
tc
.
name
+
" invalid"
,
func
(
t
*
testing
.
T
)
{
m
:=
map
[
string
]
interface
{}{
tc
.
keyName
:
tc
.
invalid
,
}
ol
:=
newOptionLoader
(
m
)
loader
:=
reflect
.
ValueOf
(
ol
)
.
MethodByName
(
methodName
)
callValues
:=
[]
reflect
.
Value
{
reflect
.
ValueOf
(
tc
.
keyName
)}
values
:=
loader
.
Call
(
callValues
)
require
.
Len
(
t
,
values
,
1
)
require
.
EqualValues
(
t
,
tc
.
expected
,
values
[
0
]
.
Interface
())
})
t
.
Run
(
tc
.
name
+
" previous error"
,
func
(
t
*
testing
.
T
)
{
m
:=
map
[
string
]
interface
{}{
tc
.
keyName
:
tc
.
invalid
,
}
ol
:=
newOptionLoader
(
m
)
ol
.
err
=
errors
.
New
(
"error"
)
loader
:=
reflect
.
ValueOf
(
ol
)
.
MethodByName
(
methodName
)
callValues
:=
[]
reflect
.
Value
{
reflect
.
ValueOf
(
tc
.
keyName
)}
loader
.
Call
(
callValues
)
require
.
Error
(
t
,
ol
.
err
)
})
}
}
}
func
withApp
(
t
*
testing
.
T
,
fn
func
(
*
mocks
.
App
))
{
func
withApp
(
t
*
testing
.
T
,
fn
func
(
*
mocks
.
App
))
{
...
...
actions/apply.go
View file @
c6b1d85c
...
@@ -54,13 +54,13 @@ func newApply(m map[string]interface{}, opts ...applyOpt) (*Apply, error) {
...
@@ -54,13 +54,13 @@ func newApply(m map[string]interface{}, opts ...applyOpt) (*Apply, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
a
:=
&
Apply
{
a
:=
&
Apply
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
clientConfig
:
ol
.
l
oadClientConfig
(),
clientConfig
:
ol
.
L
oadClientConfig
(),
componentNames
:
ol
.
l
oadStringSlice
(
OptionComponentNames
),
componentNames
:
ol
.
L
oadStringSlice
(
OptionComponentNames
),
create
:
ol
.
l
oadBool
(
OptionCreate
),
create
:
ol
.
L
oadBool
(
OptionCreate
),
dryRun
:
ol
.
l
oadBool
(
OptionDryRun
),
dryRun
:
ol
.
L
oadBool
(
OptionDryRun
),
gcTag
:
ol
.
l
oadString
(
OptionGcTag
),
gcTag
:
ol
.
L
oadString
(
OptionGcTag
),
skipGc
:
ol
.
l
oadBool
(
OptionSkipGc
),
skipGc
:
ol
.
L
oadBool
(
OptionSkipGc
),
runApplyFn
:
cluster
.
RunApply
,
runApplyFn
:
cluster
.
RunApply
,
}
}
...
...
actions/component_list.go
View file @
c6b1d85c
...
@@ -50,9 +50,9 @@ func NewComponentList(m map[string]interface{}) (*ComponentList, error) {
...
@@ -50,9 +50,9 @@ func NewComponentList(m map[string]interface{}) (*ComponentList, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
cl
:=
&
ComponentList
{
cl
:=
&
ComponentList
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
module
:
ol
.
l
oadString
(
OptionModule
),
module
:
ol
.
L
oadString
(
OptionModule
),
output
:
ol
.
l
oadString
(
OptionOutput
),
output
:
ol
.
L
oadString
(
OptionOutput
),
cm
:
component
.
DefaultManager
,
cm
:
component
.
DefaultManager
,
out
:
os
.
Stdout
,
out
:
os
.
Stdout
,
...
...
actions/component_rm.go
View file @
c6b1d85c
...
@@ -43,8 +43,8 @@ func NewComponentRm(m map[string]interface{}) (*ComponentRm, error) {
...
@@ -43,8 +43,8 @@ func NewComponentRm(m map[string]interface{}) (*ComponentRm, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
cr
:=
&
ComponentRm
{
cr
:=
&
ComponentRm
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
name
:
ol
.
l
oadString
(
OptionComponentName
),
name
:
ol
.
L
oadString
(
OptionComponentName
),
componentDeleteFn
:
component
.
Delete
,
componentDeleteFn
:
component
.
Delete
,
}
}
...
...
actions/current_environment.go
View file @
c6b1d85c
...
@@ -26,7 +26,7 @@ type currentEnver interface {
...
@@ -26,7 +26,7 @@ type currentEnver interface {
}
}
func
setCurrentEnv
(
em
environmentMetadata
,
ce
currentEnver
,
ol
*
optionLoader
)
error
{
func
setCurrentEnv
(
em
environmentMetadata
,
ce
currentEnver
,
ol
*
optionLoader
)
error
{
envName
:=
ol
.
l
oadOptionalString
(
OptionEnvName
)
envName
:=
ol
.
L
oadOptionalString
(
OptionEnvName
)
if
envName
==
""
{
if
envName
==
""
{
envName
=
em
.
CurrentEnvironment
()
envName
=
em
.
CurrentEnvironment
()
}
}
...
...
actions/delete.go
View file @
c6b1d85c
...
@@ -51,10 +51,10 @@ func newDelete(m map[string]interface{}, opts ...deleteOpt) (*Delete, error) {
...
@@ -51,10 +51,10 @@ func newDelete(m map[string]interface{}, opts ...deleteOpt) (*Delete, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
d
:=
&
Delete
{
d
:=
&
Delete
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
clientConfig
:
ol
.
l
oadClientConfig
(),
clientConfig
:
ol
.
L
oadClientConfig
(),
componentNames
:
ol
.
l
oadStringSlice
(
OptionComponentNames
),
componentNames
:
ol
.
L
oadStringSlice
(
OptionComponentNames
),
gracePeriod
:
ol
.
l
oadInt64
(
OptionGracePeriod
),
gracePeriod
:
ol
.
L
oadInt64
(
OptionGracePeriod
),
runDeleteFn
:
cluster
.
RunDelete
,
runDeleteFn
:
cluster
.
RunDelete
,
}
}
...
...
actions/env_add.go
View file @
c6b1d85c
...
@@ -47,12 +47,12 @@ func NewEnvAdd(m map[string]interface{}) (*EnvAdd, error) {
...
@@ -47,12 +47,12 @@ func NewEnvAdd(m map[string]interface{}) (*EnvAdd, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
ea
:=
&
EnvAdd
{
ea
:=
&
EnvAdd
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
envName
:
ol
.
l
oadString
(
OptionEnvName
),
envName
:
ol
.
L
oadString
(
OptionEnvName
),
server
:
ol
.
l
oadString
(
OptionServer
),
server
:
ol
.
L
oadString
(
OptionServer
),
namespace
:
ol
.
l
oadString
(
OptionModule
),
namespace
:
ol
.
L
oadString
(
OptionModule
),
k8sSpecFlag
:
ol
.
l
oadString
(
OptionSpecFlag
),
k8sSpecFlag
:
ol
.
L
oadString
(
OptionSpecFlag
),
isOverride
:
ol
.
l
oadBool
(
OptionOverride
),
isOverride
:
ol
.
L
oadBool
(
OptionOverride
),
envCreateFn
:
env
.
Create
,
envCreateFn
:
env
.
Create
,
}
}
...
...
actions/env_current.go
View file @
c6b1d85c
...
@@ -48,9 +48,9 @@ func newEnvCurrent(m map[string]interface{}) (*EnvCurrent, error) {
...
@@ -48,9 +48,9 @@ func newEnvCurrent(m map[string]interface{}) (*EnvCurrent, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
d
:=
&
EnvCurrent
{
d
:=
&
EnvCurrent
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
envName
:
ol
.
l
oadOptionalString
(
OptionEnvName
),
envName
:
ol
.
L
oadOptionalString
(
OptionEnvName
),
unset
:
ol
.
l
oadBool
(
OptionUnset
),
unset
:
ol
.
L
oadBool
(
OptionUnset
),
out
:
os
.
Stdout
,
out
:
os
.
Stdout
,
}
}
...
...
actions/env_describe.go
View file @
c6b1d85c
...
@@ -46,8 +46,8 @@ func NewEnvDescribe(m map[string]interface{}) (*EnvDescribe, error) {
...
@@ -46,8 +46,8 @@ func NewEnvDescribe(m map[string]interface{}) (*EnvDescribe, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
ed
:=
&
EnvDescribe
{
ed
:=
&
EnvDescribe
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
envName
:
ol
.
l
oadString
(
OptionEnvName
),
envName
:
ol
.
L
oadString
(
OptionEnvName
),
out
:
os
.
Stdout
,
out
:
os
.
Stdout
,
}
}
...
...
actions/env_list.go
View file @
c6b1d85c
...
@@ -48,8 +48,8 @@ func NewEnvList(m map[string]interface{}) (*EnvList, error) {
...
@@ -48,8 +48,8 @@ func NewEnvList(m map[string]interface{}) (*EnvList, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
el
:=
&
EnvList
{
el
:=
&
EnvList
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
outputType
:
ol
.
l
oadOptionalString
(
OptionOutput
),
outputType
:
ol
.
L
oadOptionalString
(
OptionOutput
),
out
:
os
.
Stdout
,
out
:
os
.
Stdout
,
}
}
...
...
actions/env_rm.go
View file @
c6b1d85c
...
@@ -46,9 +46,9 @@ func NewEnvRm(m map[string]interface{}) (*EnvRm, error) {
...
@@ -46,9 +46,9 @@ func NewEnvRm(m map[string]interface{}) (*EnvRm, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
ea
:=
&
EnvRm
{
ea
:=
&
EnvRm
{
app
:
ol
.
l
oadApp
(),
app
:
ol
.
L
oadApp
(),
envName
:
ol
.
l
oadString
(
OptionEnvName
),
envName
:
ol
.
L
oadString
(
OptionEnvName
),
isOverride
:
ol
.
l
oadBool
(
OptionOverride
),
isOverride
:
ol
.
L
oadBool
(
OptionOverride
),
envDeleteFn
:
env
.
Delete
,
envDeleteFn
:
env
.
Delete
,
}
}
...
...
actions/env_set.go
View file @
c6b1d85c
...
@@ -64,10 +64,10 @@ func NewEnvSet(m map[string]interface{}) (*EnvSet, error) {
...
@@ -64,10 +64,10 @@ func NewEnvSet(m map[string]interface{}) (*EnvSet, error) {
ol
:=
newOptionLoader
(
m
)
ol
:=
newOptionLoader
(
m
)
es
:=
&
EnvSet
{