Files
my-rook-config/pkg/daemon/ceph/test/info.go
T
Madhu Rajanna 81688398f2 cleanup: use err.Wrap when the formatting is not required
Replaced err.Wrapf with err.Wrap when the formatting
is not required.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-04-29 17:42:59 +05:30

23 lines
598 B
Go

package test
import (
"io/ioutil"
"os"
"path"
"github.com/pkg/errors"
)
func CreateConfigDir(configDir string) error {
if err := os.MkdirAll(configDir, 0744); err != nil {
return errors.Wrap(err, "error while creating directory")
}
if err := ioutil.WriteFile(path.Join(configDir, "client.admin.keyring"), []byte("key = adminsecret"), 0644); err != nil {
return errors.Wrap(err, "admin writefile error")
}
if err := ioutil.WriteFile(path.Join(configDir, "mon.keyring"), []byte("key = monsecret"), 0644); err != nil {
return errors.Wrap(err, "mon writefile error")
}
return nil
}