Skip to content

Commit

Permalink
chore: fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Aug 20, 2024
1 parent 269d3b3 commit bcb4b20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/generator/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ func composeToServiceValues(
}
}

baseimage := lagoon.CheckServiceLagoonLabel(composeServiceValues.Labels, "lagoon.base.image")
baseimage := lagoon.CheckDockerComposeLagoonLabel(composeServiceValues.Labels, "lagoon.base.image")
if baseimage != "" {
// First, let's ensure that the structure of the base image is valid
if !reference.ReferenceRegexp.MatchString(baseimage) {
return ServiceValues{}, fmt.Errorf("the 'lagoon.base.image' label defined on service %s in the docker-compose file is invalid ('%s') - please ensure it conforms to the structure `[REGISTRY_HOST[:REGISTRY_PORT]/]REPOSITORY[:TAG|@DIGEST]`", composeService, baseimage)
return nil, fmt.Errorf("the 'lagoon.base.image' label defined on service %s in the docker-compose file is invalid ('%s') - please ensure it conforms to the structure `[REGISTRY_HOST[:REGISTRY_PORT]/]REPOSITORY[:TAG|@DIGEST]`", composeService, baseimage)
}
buildValues.ForcePullImages = append(buildValues.ForcePullImages, baseimage)
}
Expand Down
9 changes: 5 additions & 4 deletions internal/generator/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package generator

import (
"encoding/json"
"reflect"
"testing"
"time"

composetypes "github.com/compose-spec/compose-go/types"
"github.com/uselagoon/build-deploy-tool/internal/dbaasclient"
"github.com/uselagoon/build-deploy-tool/internal/helpers"
"github.com/uselagoon/build-deploy-tool/internal/lagoon"
"reflect"
"testing"
"time"
)

func Test_composeToServiceValues(t *testing.T) {
Expand Down Expand Up @@ -1231,7 +1232,7 @@ func Test_composeToServiceValues(t *testing.T) {
Image: "uselagoon/fake-redis:7",
},
},
want: ServiceValues{},
want: nil,
wantErr: true,
},
}
Expand Down

0 comments on commit bcb4b20

Please sign in to comment.