-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: consistent commands running (#792)
* fix: consistent commands running * fix: consistent commands running * fix: fixed todo comment * fixed common
- Loading branch information
Showing
43 changed files
with
285 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ctl-testkube/commands/executors/common.go → ...ubectl-testkube/commands/common/client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
cmd/kubectl-testkube/commands/common/validator/directory.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package validator | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func ManifestsDirectory(cmd *cobra.Command, args []string) error { | ||
if len(args) < 1 { | ||
return errors.New("please pass directory with manifest files as argument") | ||
} | ||
return nil | ||
} |
14 changes: 14 additions & 0 deletions
14
cmd/kubectl-testkube/commands/common/validator/executionid.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package validator | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func ExecutionID(cmd *cobra.Command, args []string) error { | ||
if len(args) < 1 { | ||
return errors.New("please pass execution ID as argument") | ||
} | ||
return nil | ||
} |
14 changes: 14 additions & 0 deletions
14
cmd/kubectl-testkube/commands/common/validator/executionidfilename.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package validator | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func ExecutionIDAndFileNames(cmd *cobra.Command, args []string) error { | ||
if len(args) < 3 { | ||
return errors.New("please pass 'Execution ID' ,'Filename' and 'Destination Directory' as arguments") | ||
} | ||
return nil | ||
} |
16 changes: 16 additions & 0 deletions
16
cmd/kubectl-testkube/commands/common/validator/executorname.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package validator | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func ExecutorName(cmd *cobra.Command, args []string) error { | ||
// TODO validate executor name as valid kubernetes resource name | ||
|
||
if len(args) < 1 { | ||
return errors.New("please pass valid executor-name") | ||
} | ||
return nil | ||
} |
16 changes: 16 additions & 0 deletions
16
cmd/kubectl-testkube/commands/common/validator/scriptname.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package validator | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func ScriptName(cmd *cobra.Command, args []string) error { | ||
// TODO validate script name as valid kubernetes resource name | ||
|
||
if len(args) < 1 { | ||
return errors.New("please pass valid script-name") | ||
} | ||
return nil | ||
} |
16 changes: 16 additions & 0 deletions
16
cmd/kubectl-testkube/commands/common/validator/testname.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package validator | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func TestName(cmd *cobra.Command, args []string) error { | ||
// TODO validate test name as valid kubernetes resource name | ||
|
||
if len(args) < 1 { | ||
return errors.New("please pass valid test-name") | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.