Merge "Remove EnsureComplete config object validation from GetCurrentContext"
This commit is contained in:
commit
99234bad5d
@ -615,9 +615,6 @@ func (c *Config) ModifyContext(context *Context, theContext *ContextOptions) {
|
||||
// Manifest is the default manifest to be use with this context
|
||||
// Purpose for this method is simplifying the current context information
|
||||
func (c *Config) GetCurrentContext() (*Context, error) {
|
||||
if err := c.EnsureComplete(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
currentContext, err := c.GetContext(c.CurrentContext)
|
||||
if err != nil {
|
||||
// this should not happen since Ensure Complete checks for this
|
||||
|
@ -420,21 +420,6 @@ func TestGetCurrentContext(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, conf.Contexts[currentContextName], context)
|
||||
})
|
||||
|
||||
t.Run("getCurrentContextIncomplete", func(t *testing.T) {
|
||||
conf, cleanup := testutil.InitConfig(t)
|
||||
defer cleanup(t)
|
||||
|
||||
context, err := conf.GetCurrentContext()
|
||||
require.Error(t, err)
|
||||
assert.Nil(t, context)
|
||||
|
||||
conf.CurrentContext = currentContextName
|
||||
|
||||
context, err = conf.GetCurrentContext()
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, context)
|
||||
})
|
||||
}
|
||||
|
||||
func TestCurrentContextCluster(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user