diff --git a/pkg/config/config.go b/pkg/config/config.go index 6ce0a7e6b..3f595a64f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -610,9 +610,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 diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index e58e9742b..4d6be2025 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -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) {