Skip to content

Commit

Permalink
fix(cloud): Allow read-only volumes in compose
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
  • Loading branch information
craciunoiuc committed Dec 6, 2024
1 parent 832bb8f commit 3ce79a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/cli/kraft/cloud/compose/up/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ func Up(ctx context.Context, opts *UpOptions, args ...string) error {
continue
}

volumes = append(volumes, fmt.Sprintf("%s:%s", vol.UUID, volume.Target))
volAttach := fmt.Sprintf("%s:%s", vol.UUID, volume.Target)
if volume.ReadOnly {
volAttach = fmt.Sprintf("%s:%s", volAttach, ":ro")
}

volumes = append(volumes, volAttach)
}

name := strings.ReplaceAll(fmt.Sprintf("%s-%s", opts.Project.Name, service.Name), "_", "-")
Expand Down

0 comments on commit 3ce79a2

Please sign in to comment.