Skip to content

Commit

Permalink
Merge pull request #165 from uselagoon/lagoon_type_check
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood authored Jan 3, 2023
2 parents 6c3f447 + 2fe73a4 commit 6a2f975
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion internal/generator/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ func composeToServiceValues(
if composeServiceValues.Labels != nil {
lagoonType = lagoon.CheckServiceLagoonLabel(composeServiceValues.Labels, "lagoon.type")
}
if lagoonType != "" {
if lagoonType == "" {
return ServiceValues{}, fmt.Errorf("No lagoon.type has been set for service %s. If a Lagoon service is not required, please set the lagoon.type to 'none' for this service in docker-compose.yaml. See the Lagoon documentation for supported service types.", composeService)
} else {
// if the lagoontype is populated, even none is valid as there may be a servicetype override in an environment variable
autogenEnabled := true
autogenTLSAcmeEnabled := true
Expand Down
3 changes: 2 additions & 1 deletion internal/generator/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ func Test_composeToServiceValues(t *testing.T) {
composeService: "nginx",
composeServiceValues: composetypes.ServiceConfig{},
},
want: ServiceValues{},
want: ServiceValues{},
wantErr: true,
},
{
name: "test9 - type none, no service",
Expand Down

0 comments on commit 6a2f975

Please sign in to comment.