Exemple #1
0
// HandleDockerError handles an an error from the docker daemon
func (c *NodeConfig) HandleDockerError(message string) {
	if !c.AllowDisabledDocker {
		glog.Fatalf("ERROR: %s", message)
	}
	glog.Errorf("WARNING: %s", message)
	c.DockerClient = &dockertools.FakeDockerClient{VersionInfo: dockerclient.Env([]string{"ApiVersion=1.18"})}
}
Exemple #2
0
func newContainer(
	c *dockercli.Container,
	endpoint string,
	dropper report.Reporter,
	annotator report.Reporter,
) (res *Container) {
	res = &Container{
		id:        c.ID,
		name:      strings.TrimPrefix(c.Name, "/"),
		endpoint:  endpoint,
		statMutex: &sync.Mutex{},
		annotator: annotator,
	}

	// Check for "WAVES_IGNORE" env
	env := dockercli.Env(c.Config.Env)
	if env.Get("WAVES_WATCH") != "" {
		res.watch = true
		escaped := res.formatName(c.Name)
		res.dropper = report.NewMetaReporter([]string{escaped}, dropper)
	} else {
		logx.Infof("using dummy mode for %s", res.name)
	}
	return
}