Skip to content

Commit

Permalink
hacking
Browse files Browse the repository at this point in the history
  • Loading branch information
sebv committed Oct 1, 2023
1 parent 991e624 commit 5d00267
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/imagerunner/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ func ValidateServices(service []SuiteService, suiteName string) error {
if service.Image == "" {
return fmt.Errorf(msg.MissingServiceImage, service.Name, suiteName)
}
if service.ResourceProfile != "" && !sliceContainsString(ValidResourceProfiles, service.ResourceProfile) {
return fmt.Errorf(msg.InvalidServiceResourceProfile, service.Name, suiteName, ValidResourceProfiles)
if service.ResourceProfile != "" && !ValidResourceProfilesValidator.MatchString(service.ResourceProfile) {
return fmt.Errorf(msg.InvalidServiceResourceProfile, service.Name, suiteName, ValidResourceProfilesFormat)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/imagerunner/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestValidate(t *testing.T) {
},
},
},
wantErr: `invalid resourceProfile for service: myservice in suite: Main Suite, resourceProfile should be one of [c1m1 c2m2 c3m3]`,
wantErr: `invalid resourceProfile for service: myservice in suite: Main Suite, resourceProfile should be of format cXmX`,
},
}
for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion internal/msg/errormsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const (
// MissingServiceImage indicates no docker image provided
MissingServiceImage = `missing "image" for service: %s in suite: %s`
// InvalidServiceResourceProfile indicates the service resourceProfile is not valid
InvalidServiceResourceProfile = "invalid resourceProfile for service: %s in suite: %s, resourceProfile should be one of %v"
InvalidServiceResourceProfile = "invalid resourceProfile for service: %s in suite: %s, resourceProfile should be of format %v"
)

// testcafe config settings
Expand Down

0 comments on commit 5d00267

Please sign in to comment.