Skip to content

Commit

Permalink
fix(up): Switch the check order: prefer official images over user images
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <[email protected]>
  • Loading branch information
nderjung committed Jun 28, 2024
1 parent 769ed33 commit 7fabeca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/cli/kraft/cloud/compose/up/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ func Up(ctx context.Context, opts *UpOptions, args ...string) error {
)
}

if exists, _ := opts.imageExists(ctx, userPkgName); userPkgName != "" && exists {
if exists, _ := opts.imageExists(ctx, officialPkgName); officialPkgName != "" && exists {
// Override the image name if it is set with the new package name.
service.Image = userPkgName
service.Image = officialPkgName
opts.Project.Services[serviceName] = service

} else if exists, _ := opts.imageExists(ctx, officialPkgName); officialPkgName != "" && exists {
} else if exists, _ := opts.imageExists(ctx, userPkgName); userPkgName != "" && exists {
// Override the image name if it is set with the new package name.
service.Image = officialPkgName
service.Image = userPkgName
opts.Project.Services[serviceName] = service

} else if opts.NoBuild {
Expand Down

0 comments on commit 7fabeca

Please sign in to comment.