Skip to content

Commit 2697b9c

Browse files
committed
fix WithProfiles to return a project wih Profiles set
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent f0d27fc commit 2697b9c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

types/project.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ func (s ServiceConfig) HasProfile(profiles []string) bool {
332332
return true
333333
}
334334
for _, p := range profiles {
335+
if p == "*" {
336+
return true
337+
}
335338
for _, sp := range s.Profiles {
336339
if sp == p {
337340
return true
@@ -345,11 +348,6 @@ func (s ServiceConfig) HasProfile(profiles []string) bool {
345348
// It returns a new Project instance with the changes and keep the original Project unchanged
346349
func (p *Project) WithProfiles(profiles []string) (*Project, error) {
347350
newProject := p.deepCopy()
348-
for _, p := range profiles {
349-
if p == "*" {
350-
return newProject, nil
351-
}
352-
}
353351
enabled := Services{}
354352
disabled := Services{}
355353
for name, service := range newProject.AllServices() {

0 commit comments

Comments
 (0)