Skip to content

Commit

Permalink
fix(run): Don't erase existing volumes when passing volume arg (#1454)
Browse files Browse the repository at this point in the history
Reviewed-by: Alexander Jung <[email protected]>
Approved-by: Alexander Jung <[email protected]>
  • Loading branch information
nderjung authored Mar 26, 2024
2 parents 74d7fb8 + 5118d9d commit 725f0f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/cli/kraft/run/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ func (opts *RunOptions) parseVolumes(ctx context.Context, machine *machineapi.Ma

var err error
controllers := map[string]volumeapi.VolumeService{}
machine.Spec.Volumes = []volumeapi.Volume{}

if machine.Spec.Volumes == nil {
machine.Spec.Volumes = make([]volumeapi.Volume, 0)
}
for _, volLine := range opts.Volumes {
var hostPath, mountPath string
split := strings.Split(volLine, ":")
Expand Down

0 comments on commit 725f0f8

Please sign in to comment.