Skip to content

Commit

Permalink
fix ci bug
Browse files Browse the repository at this point in the history
Signed-off-by: sjcsjc123 <1401189096@qq.com>
  • Loading branch information
sjcsjc123 committed Oct 26, 2023
1 parent 5225ac9 commit 044d3f4
Show file tree
Hide file tree
Showing 73 changed files with 4,309 additions and 6,999 deletions.
56 changes: 56 additions & 0 deletions utils/weed/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/sirupsen/logrus"
"os"
"os/exec"
"path"
Expand Down Expand Up @@ -385,9 +386,64 @@ func (d *deployer) RemoveFile(ctx context.Context, dir string) error {
}

func NewDeployer(config *Config) Deployer {
check(config)
return &deployer{
config: config,
etcd: NewEtcd(config),
weedMaster: NewMaster(config),
}
}

func check(config *Config) {
// check config add set default value if not set
if config.LogDir == "" {
config.LogDir = "/tmp/log"
}
if config.DataDir == "" {
config.DataDir = "/tmp/data"
}
if config.PidDir == "" {
config.PidDir = "/tmp/pid"
}
if config.BinDir == "" {
config.BinDir = "/tmp/bin"
}
if config.EtcdConfigPath == "" {
config.EtcdConfigPath = "/tmp/etcd.conf"
}
if config.CurrentIP == "" {
config.CurrentIP = "127.0.0.1"
}
if config.PeerPort == 0 {
config.PeerPort = 2380
}
if config.ClientPort == 0 {
config.ClientPort = 2379
}
if config.WeedMasterPort == 0 {
config.WeedMasterPort = 9333
}
if config.WeedVolumePort == 0 {
config.WeedVolumePort = 8080
}
if config.WeedMasterDir == "" {
config.WeedMasterDir = "/tmp/weed-master"
}
if config.WeedVolumeDir == "" {
config.WeedVolumeDir = "/tmp/weed-volume"
}
if config.DefaultReplication == "" {
config.DefaultReplication = "003"
}
if config.WeedLogDir == "" {
config.WeedLogDir = "/tmp/weed-log"
}
if len(config.MasterIP) == 0 {
logrus.Error("master ip list is empty")
os.Exit(1)
}
if len(config.VolumeIP) == 0 {
logrus.Error("volume ip list is empty")
os.Exit(1)
}
}
10 changes: 5 additions & 5 deletions vendor/github.com/fsnotify/fsnotify/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 0 additions & 62 deletions vendor/github.com/fsnotify/fsnotify/AUTHORS

This file was deleted.

113 changes: 113 additions & 0 deletions vendor/github.com/fsnotify/fsnotify/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 19 additions & 53 deletions vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 044d3f4

Please sign in to comment.