Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import docker util #585

Merged
merged 16 commits into from
Sep 20, 2017
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
2 changes: 1 addition & 1 deletion Gopkg.lock

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

8 changes: 8 additions & 0 deletions cmd/agent/app/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/DataDog/datadog-agent/pkg/config"
"github.com/DataDog/datadog-agent/pkg/serializer"
"github.com/DataDog/datadog-agent/pkg/status"
"github.com/DataDog/datadog-agent/pkg/tagger"
"github.com/DataDog/datadog-agent/pkg/util"
"github.com/DataDog/datadog-agent/pkg/util/cache"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -81,6 +82,13 @@ var checkCmd = &cobra.Command{
return err
}

// start tagging system for containers
err = tagger.Init()
if err != nil {
fmt.Printf("Unable to start tagging system: %s", err)
return err
}

s := &serializer.Serializer{Forwarder: common.Forwarder}
agg := aggregator.InitAggregatorWithFlushInterval(s, hostname, 10000000000)
common.SetupAutoConfig(config.Datadog.GetString("confd_path"))
Expand Down
7 changes: 7 additions & 0 deletions cmd/agent/app/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/DataDog/datadog-agent/pkg/metadata"
"github.com/DataDog/datadog-agent/pkg/pidfile"
"github.com/DataDog/datadog-agent/pkg/serializer"
"github.com/DataDog/datadog-agent/pkg/tagger"
"github.com/DataDog/datadog-agent/pkg/util"
"github.com/DataDog/datadog-agent/pkg/util/cache"
"github.com/DataDog/datadog-agent/pkg/version"
Expand Down Expand Up @@ -165,6 +166,12 @@ func StartAgent() error {
return log.Errorf("Error while starting api server, exiting: %v", err)
}

// start tagging system for containers
err = tagger.Init()
if err != nil {
return log.Errorf("Unable to start tagging system: %s", err)
}

// setup the forwarder
keysPerDomain, err := config.GetMultipleEndpoints()
if err != nil {
Expand Down
Loading