From 3c6ebd8f2a863ed56ef298db085dcc3c01be63eb Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Fri, 22 Dec 2023 12:08:16 +0100 Subject: [PATCH] fix: remote-source with ssh pattern Signed-off-by: gabriel-farache --- internal/filesystem/filesystem.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/filesystem/filesystem.go b/internal/filesystem/filesystem.go index f0a49b9..57205e2 100644 --- a/internal/filesystem/filesystem.go +++ b/internal/filesystem/filesystem.go @@ -2206,8 +2206,8 @@ func validateAndProcessPlan(plan string, shouldProcess bool) (string, error) { return "", fmt.Errorf("'spec.sourceDir' is missing from the plan") } else if pSpecSourceDir, ok := pSpecSourceDirI.(string); !ok { return "", fmt.Errorf("'spec.sourceDir' is not a string. Actual value is %+v of type %T", pSpecSourceDirI, pSpecSourceDirI) - } else if pSpecSourceDir != SOURCES_DIR && pSpecSourceDir != "" && !strings.HasPrefix(pSpecSourceDir, "git+https://") { - return "", fmt.Errorf("'spec.sourceDir' is invalid. Expected 'source' or 'git+https:// . Actual: %s", pSpecSourceDir) + } else if pSpecSourceDir != SOURCES_DIR && pSpecSourceDir != "" && !strings.HasPrefix(pSpecSourceDir, "git+") { + return "", fmt.Errorf("'spec.sourceDir' is invalid. Expected 'source' or 'git+[https|ssh]:// . Actual: %s", pSpecSourceDir) } else { // TODO: better processing of the plan pMeta["name"], _ = common.NormalizeName(pMetaName) @@ -2333,7 +2333,7 @@ func (fs *FileSystem) runPlan(currentRunDir string, currentRunConfigPaths []stri } // update state logrus.Debug("planning finished. inside Update. just before update start") - if strings.HasPrefix(currentRunSrcDir, "git+https://") { + if strings.HasPrefix(currentRunSrcDir, "git+") { project.Status[types.ProjectStatusRemoteInputSources] = true } project.Status[types.ProjectStatusPlanning] = false