forked from rook/rook
Enable prometheus module on mgr with pkg/ceph/client.MgrEnableModule() Added force option to MgrEnableModule()
22 lines
474 B
Go
22 lines
474 B
Go
package client
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/rook/rook/pkg/clusterd"
|
|
)
|
|
|
|
// MgrEnableModule Enable module for mgr
|
|
func MgrEnableModule(context *clusterd.Context, clusterName, name string, force bool) error {
|
|
args := []string{"mgr", "module", "enable", name}
|
|
if force {
|
|
args = append(args, "--force")
|
|
}
|
|
_, err := ExecuteCephCommand(context, clusterName, args)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to mgr module enable for %s: %+v", name, err)
|
|
}
|
|
|
|
return nil
|
|
}
|