Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cmd/node-disk-manager-webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ func runWebhookServer(ctx context.Context, cfg *rest.Config, options *config.Opt
}

func newCaches(ctx context.Context, cfg *rest.Config, threadiness int) (*resourceCaches, error) {
var starters []start.Starter

disks, err := ctldisk.NewFactoryFromConfig(cfg)
if err != nil {
return nil, err
Expand All @@ -168,6 +166,7 @@ func newCaches(ctx context.Context, cfg *rest.Config, threadiness int) (*resourc
return nil, err
}

starters := make([]start.Starter, 0, 4)
starters = append(starters, disks, storageFactory, coreFactory, lhFactory)
resourceCaches := &resourceCaches{
bdCache: disks.Harvesterhci().V1beta1().BlockDevice().Cache(),
Expand Down
13 changes: 7 additions & 6 deletions pkg/utils/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ func (exec *Executor) Execute(cmd string, args []string) (string, error) {
command := cmd
cmdArgs := args
if exec.namespace != "" {
cmdArgs = []string{
"--mount=" + filepath.Join(exec.namespace, "mnt"),
"--net=" + filepath.Join(exec.namespace, "net"),
"--ipc=" + filepath.Join(exec.namespace, "ipc"),
cmdArgs = make([]string, 0, len(args)+4)
cmdArgs = append(cmdArgs,
"--mount="+filepath.Join(exec.namespace, "mnt"),
"--net="+filepath.Join(exec.namespace, "net"),
"--ipc="+filepath.Join(exec.namespace, "ipc"),
cmd,
}
command = NSBinary
)
cmdArgs = append(cmdArgs, args...)
command = NSBinary
}
return execute(command, cmdArgs, exec.cmdTimeout)
}
Expand Down
Loading