ValidateStarterProjects checks if starter project has only one remote configured and if the checkout remote matches the remote configured
(starterProjects []v1alpha2.StarterProject)
| 24 | // ValidateStarterProjects checks if starter project has only one remote configured |
| 25 | // and if the checkout remote matches the remote configured |
| 26 | func ValidateStarterProjects(starterProjects []v1alpha2.StarterProject) (returnedErr error) { |
| 27 | |
| 28 | for _, starterProject := range starterProjects { |
| 29 | var gitSource v1alpha2.GitLikeProjectSource |
| 30 | if starterProject.Git != nil { |
| 31 | gitSource = starterProject.Git.GitLikeProjectSource |
| 32 | } else { |
| 33 | continue |
| 34 | } |
| 35 | |
| 36 | if starterProjectErr := validateSingleRemoteGitSrc("starterProject", starterProject.Name, gitSource); starterProjectErr != nil { |
| 37 | newErr := resolveErrorMessageWithImportAttributes(starterProjectErr, starterProject.Attributes) |
| 38 | returnedErr = multierror.Append(returnedErr, newErr) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | return returnedErr |
| 43 | } |
| 44 | |
| 45 | // ValidateProjects checks if the project has more than one remote configured then a checkout |
| 46 | // remote is mandatory and if the checkout remote matches the renote configured |