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

[RC][Fleet] Change Updater to use newly implemented RC CDN client #29219

Merged
merged 16 commits into from
Sep 26, 2024
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
26 changes: 17 additions & 9 deletions cmd/installer/subcommands/installer/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func newInstallerCmd(operation string) (_ *installerCmd, err error) {
cmd.Stop(err)
}
}()
i, err := installer.NewInstaller(cmd.env)
i, err := installer.NewInstaller(cmd.env, "opt/datadog-packages/run/rc/cmd")
if err != nil {
return nil, err
}
Expand All @@ -119,6 +119,14 @@ func newInstallerCmd(operation string) (_ *installerCmd, err error) {
}, nil
}

func (i *installerCmd) stop(err error) {
i.cmd.Stop(err)
err = i.Installer.Close()
if err != nil {
fmt.Fprintf(os.Stderr, "failed to close Installer: %v\n", err)
}
}

type bootstraperCmd struct {
*cmd
}
Expand Down Expand Up @@ -228,7 +236,7 @@ func installCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
i.span.SetTag("params.url", args[0])
return i.Install(i.ctx, args[0], installArgs)
},
Expand All @@ -248,7 +256,7 @@ func removeCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
i.span.SetTag("params.package", args[0])
return i.Remove(i.ctx, args[0])
},
Expand All @@ -267,7 +275,7 @@ func purgeCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
i.Purge(i.ctx)
return nil
},
Expand All @@ -286,7 +294,7 @@ func installExperimentCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
i.span.SetTag("params.url", args[0])
return i.InstallExperiment(i.ctx, args[0])
},
Expand All @@ -305,7 +313,7 @@ func removeExperimentCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
i.span.SetTag("params.package", args[0])
return i.RemoveExperiment(i.ctx, args[0])
},
Expand All @@ -324,7 +332,7 @@ func promoteExperimentCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
i.span.SetTag("params.package", args[0])
return i.PromoteExperiment(i.ctx, args[0])
},
Expand All @@ -343,7 +351,7 @@ func garbageCollectCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
return i.GarbageCollect(i.ctx)
},
}
Expand All @@ -366,7 +374,7 @@ func isInstalledCommand() *cobra.Command {
if err != nil {
return err
}
defer func() { i.Stop(err) }()
defer i.stop(err)
installed, err := i.IsInstalled(i.ctx, args[0])
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/DataDog/aptly v1.5.3 // indirect
github.com/DataDog/extendeddaemonset v0.10.0-rc.4 // indirect
github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect
github.com/DataDog/go-tuf v1.1.0-0.5.2
github.com/DataDog/gostackparse v0.7.0 // indirect
github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect
github.com/DisposaBoy/JsonConfigReader v0.0.0-20201129172854-99cf318d67e7 // indirect
Expand Down
27 changes: 23 additions & 4 deletions pkg/config/remote/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ replace (
github.com/DataDog/datadog-agent/comp/core/telemetry => ../../../comp/core/telemetry
github.com/DataDog/datadog-agent/comp/def => ../../../comp/def
github.com/DataDog/datadog-agent/pkg/config/model => ../model
github.com/DataDog/datadog-agent/pkg/obfuscate => ../../obfuscate
github.com/DataDog/datadog-agent/pkg/proto => ../../proto
github.com/DataDog/datadog-agent/pkg/remoteconfig/state => ../../remoteconfig/state
github.com/DataDog/datadog-agent/pkg/telemetry => ../../telemetry
Expand Down Expand Up @@ -36,14 +37,27 @@ require (
go.etcd.io/bbolt v1.3.7
go.uber.org/atomic v1.11.0
google.golang.org/protobuf v1.33.0
gopkg.in/DataDog/dd-trace-go.v1 v1.67.0
)

require (
github.com/DataDog/appsec-internal-go v1.7.0 // indirect
github.com/DataDog/datadog-agent/pkg/obfuscate v0.48.0 // indirect
github.com/DataDog/datadog-agent/pkg/util/cache v0.56.0-rc.3 // indirect
github.com/DataDog/datadog-go/v5 v5.5.0 // indirect
github.com/DataDog/go-libddwaf/v3 v3.3.0 // indirect
github.com/DataDog/go-sqllexer v0.0.14 // indirect
github.com/DataDog/sketches-go v1.4.5 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.6.0-alpha.5 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/outcaste-io/ristretto v0.2.3 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
Expand All @@ -53,24 +67,29 @@ require (
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
)

require (
github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 // indirect
github.com/DataDog/go-tuf v1.1.0-0.5.2
github.com/DataDog/viper v1.13.5 // indirect
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
Expand Down
Loading
Loading