expose: --dry-run should dump the object
Also make some tests use --dry-run and compare generated objects against expected
This commit is contained in:
@@ -228,12 +228,6 @@ func NewAPIFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
|
||||
ClientConfig: func() (*client.Config, error) {
|
||||
return t.ClientConfig, t.Err
|
||||
},
|
||||
CanBeExposed: func(kind string) error {
|
||||
if kind != "ReplicationController" && kind != "Service" && kind != "Pod" {
|
||||
return fmt.Errorf("invalid resource provided: %v, only a replication controller, service or pod is accepted", kind)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
Generator: func(name string) (kubectl.Generator, bool) {
|
||||
generator, ok := generators[name]
|
||||
return generator, ok
|
||||
@@ -241,6 +235,7 @@ func NewAPIFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
|
||||
}
|
||||
rf := cmdutil.NewFactory(nil)
|
||||
f.PodSelectorForObject = rf.PodSelectorForObject
|
||||
f.CanBeExposed = rf.CanBeExposed
|
||||
return f, t, testapi.Default.Codec()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user