diff --git a/cmd/vela-kubernetes/config.go b/cmd/vela-kubernetes/config.go index 4767f14..32adc4e 100644 --- a/cmd/vela-kubernetes/config.go +++ b/cmd/vela-kubernetes/config.go @@ -37,21 +37,6 @@ func (c *Config) Validate() error { return fmt.Errorf("no config file provided") } - // verify cluster is provided - if len(c.Cluster) == 0 { - return fmt.Errorf("no config cluster provided") - } - - // verify context is provided - if len(c.Context) == 0 { - return fmt.Errorf("no config context provided") - } - - // verify namespace is provided - if len(c.Namespace) == 0 { - return fmt.Errorf("no config namespace provided") - } - return nil } diff --git a/cmd/vela-kubernetes/config_test.go b/cmd/vela-kubernetes/config_test.go index b62ff11..a23689b 100644 --- a/cmd/vela-kubernetes/config_test.go +++ b/cmd/vela-kubernetes/config_test.go @@ -39,48 +39,6 @@ func TestKubernetes_Config_Validate_NoFile(t *testing.T) { } } -func TestKubernetes_Config_Validate_NoCluster(t *testing.T) { - // setup types - c := &Config{ - File: "file", - Context: "context", - Namespace: "namespace", - } - - err := c.Validate() - if err == nil { - t.Errorf("Validate should have returned err") - } -} - -func TestKubernetes_Config_Validate_NoContext(t *testing.T) { - // setup types - c := &Config{ - File: "file", - Cluster: "cluster", - Namespace: "namespace", - } - - err := c.Validate() - if err == nil { - t.Errorf("Validate should have returned err") - } -} - -func TestKubernetes_Config_Validate_NoNamespace(t *testing.T) { - // setup types - c := &Config{ - File: "file", - Cluster: "cluster", - Context: "context", - } - - err := c.Validate() - if err == nil { - t.Errorf("Validate should have returned err") - } -} - func TestKubernetes_Config_Write(t *testing.T) { // setup filesystem appFS = afero.NewMemMapFs()