GetBlueprintByProjectName returns the detail of a given ProjectName
(projectName string)
| 116 | |
| 117 | // GetBlueprintByProjectName returns the detail of a given ProjectName |
| 118 | func GetBlueprintByProjectName(projectName string) (*models.Blueprint, errors.Error) { |
| 119 | if projectName == "" { |
| 120 | return nil, errors.Internal.New("can not use the empty projectName to search the unique blueprint") |
| 121 | } |
| 122 | blueprint, err := bpManager.GetDbBlueprintByProjectName(projectName) |
| 123 | if err != nil { |
| 124 | // Allow specific projectName to fail to find the corresponding blueprint |
| 125 | if db.IsErrorNotFound(err) { |
| 126 | return nil, nil |
| 127 | } |
| 128 | return nil, errors.Internal.Wrap(err, fmt.Sprintf("error getting the blueprint from database with project %s", projectName)) |
| 129 | } |
| 130 | return blueprint, nil |
| 131 | } |
| 132 | |
| 133 | func validateBlueprintAndMakePlan(blueprint *models.Blueprint) errors.Error { |
| 134 | // validation |
no test coverage detected