From 1479570016cccecc8b70df892773680d42e6c68c Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Thu, 3 Feb 2022 11:28:10 +0100 Subject: [PATCH] feat: added content errors --- pkg/api/v1/testkube/model_script_content_extended.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/api/v1/testkube/model_script_content_extended.go b/pkg/api/v1/testkube/model_script_content_extended.go index f3c3c3b94a8..45139103617 100644 --- a/pkg/api/v1/testkube/model_script_content_extended.go +++ b/pkg/api/v1/testkube/model_script_content_extended.go @@ -1,6 +1,8 @@ // content could be fetched as file or dir (many files, e.g. Cypress project) in executor package testkube +import "fmt" + type ScriptContentType string const ( @@ -10,6 +12,9 @@ const ( ScriptContentTypeGitDir ScriptContentType = "git-dir" ) +var ErrTypeNotFile = fmt.Errorf("unsupported content type use one of: file-uri, git-file, string") +var ErrTypeNotDir = fmt.Errorf("unsupported content type use one of: git-dir") + func NewStringScriptContent(str string) *ScriptContent { return &ScriptContent{ Type_: string(ScriptContentTypeGitFile),