Skip to content

Commit

Permalink
Revert "Bugfix(format): make mountpoint directories with wrong mode."
Browse files Browse the repository at this point in the history
This reverts commit 0bff214.
  • Loading branch information
Wine93 committed Jun 15, 2023
1 parent 511f0ca commit 19e2706
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
9 changes: 0 additions & 9 deletions cli/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,6 @@ 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.MkdirOptions(),
ExecOptions: curveadm.ExecOptions(),
})
t.AddStep(&step.CreateFilesystem{ // mkfs.ext4 MOUNT_POINT
Device: device,
Expand Down
4 changes: 3 additions & 1 deletion internal/task/task/common/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ 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 @@ -232,7 +234,7 @@ func NewCreateContainerTask(curveadm *cli.CurveAdm, dc *topology.DeployConfig) (
})
t.AddStep(&step.CreateDirectory{
Paths: []string{dc.GetLogDir(), dc.GetDataDir()},
ExecOptions: curveadm.MkdirOptions(),
ExecOptions: options,
})
t.AddStep(&step.CreateContainer{
Image: dc.GetContainerImage(),
Expand Down

0 comments on commit 19e2706

Please sign in to comment.