Skip to content

Commit

Permalink
Bugfix(format): make mountpoint directories with wrong mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wine93 committed Apr 18, 2023
1 parent 32f6238 commit 0bff214
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 9 additions & 0 deletions cli/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,15 @@ func (curveadm *CurveAdm) ExecOptions() module.ExecOptions {
}
}

func (curveadm *CurveAdm) MkdirOptions() module.ExecOptions {
return module.ExecOptions{
ExecWithSudo: false,
ExecInLocal: false,
ExecSudoAlias: curveadm.config.GetSudoAlias(),
ExecTimeoutSec: curveadm.config.GetTimeout(),
}
}

func (curveadm *CurveAdm) CheckId(id string) error {
services, err := curveadm.Storage().GetServices(curveadm.ClusterId())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/task/task/bs/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func NewFormatChunkfilePoolTask(curveadm *cli.CurveAdm, fc *configure.FormatConf
})
t.AddStep(&step.CreateDirectory{
Paths: []string{mountPoint},
ExecOptions: curveadm.ExecOptions(),
ExecOptions: curveadm.MkdirOptions(),
})
t.AddStep(&step.CreateFilesystem{ // mkfs.ext4 MOUNT_POINT
Device: device,
Expand Down
4 changes: 1 addition & 3 deletions internal/task/task/common/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ func NewCreateContainerTask(curveadm *cli.CurveAdm, dc *topology.DeployConfig) (
kind := dc.GetKind()
role := dc.GetRole()
hostname := fmt.Sprintf("%s-%s-%s", kind, role, serviceId)
options := curveadm.ExecOptions()
options.ExecWithSudo = false

t.AddStep(&step2GetService{ // if service exist, break task
serviceId: serviceId,
Expand All @@ -234,7 +232,7 @@ func NewCreateContainerTask(curveadm *cli.CurveAdm, dc *topology.DeployConfig) (
})
t.AddStep(&step.CreateDirectory{
Paths: []string{dc.GetLogDir(), dc.GetDataDir()},
ExecOptions: options,
ExecOptions: curveadm.MkdirOptions(),
})
t.AddStep(&step.CreateContainer{
Image: dc.GetContainerImage(),
Expand Down

0 comments on commit 0bff214

Please sign in to comment.