fix: expose attachment readonly and volume_options in storage:list json
The `storage:list <app> --format json` payload conflated the attachment's `Readonly` flag and its `VolumeOptions` field into a single derived `volume_options` string that rendered as `ro`, `<options>`, or `ro,<options>` depending on which fields were set on the underlying attachment. That shape is fine for the legacy `host:container[:options]` text view but it leaves drift-detection tooling unable to tell whether a `ro` token came from `Attachment.Readonly == true` or from the operator setting `Attachment.VolumeOptions = "ro"` directly. The JSON now exposes `readonly` (boolean) and `volume_options` (string) as separate omitempty keys populated straight from the attachment, and `formatStorageListEntry` combines them at format time for the colon- form text view. `ParseMountPath` was extended in lockstep so callers of the legacy `host:container:opts` form no longer have to special- case the `ro` token themselves.
This commit is contained in:
@@ -242,13 +242,8 @@ func mountLegacyColon(appName string, mountPath string) error {
|
||||
ContainerPath: parsed.ContainerPath,
|
||||
Phases: []string{PhaseDeploy, PhaseRun},
|
||||
ProcessType: DefaultProcessType,
|
||||
}
|
||||
switch parsed.VolumeOptions {
|
||||
case "":
|
||||
case "ro":
|
||||
attachment.Readonly = true
|
||||
default:
|
||||
attachment.VolumeOptions = parsed.VolumeOptions
|
||||
Readonly: parsed.Readonly,
|
||||
VolumeOptions: parsed.VolumeOptions,
|
||||
}
|
||||
|
||||
if err := AddAttachment(appName, attachment); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user