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

[TUF] Add flag for TUF autoupdater rollout #1524

Merged
merged 1 commit into from
Dec 21, 2023
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
9 changes: 9 additions & 0 deletions ee/agent/flags/flag_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,15 @@ func (fc *FlagController) UpdateDirectory() string {
).get(fc.getControlServerValue(keys.UpdateDirectory))
}

func (fc *FlagController) SetUseTUFAutoupdater(enabled bool) error {
return fc.setControlServerValue(keys.UseTUFAutoupdater, boolToBytes(enabled))
}
func (fc *FlagController) UseTUFAutoupdater() bool {
return NewBoolFlagValue(
WithDefaultBool(false),
).get(fc.getControlServerValue(keys.UseTUFAutoupdater))
}

func (fc *FlagController) SetExportTraces(enabled bool) error {
return fc.setControlServerValue(keys.ExportTraces, boolToBytes(enabled))
}
Expand Down
1 change: 1 addition & 0 deletions ee/agent/flags/keys/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const (
MirrorServerURL FlagKey = "mirror_url"
AutoupdateInterval FlagKey = "autoupdate_interval"
UpdateChannel FlagKey = "update_channel"
UseTUFAutoupdater FlagKey = "use_tuf_autoupdater"
NotaryPrefix FlagKey = "notary_prefix"
AutoupdateInitialDelay FlagKey = "autoupdater_initial_delay"
UpdateDirectory FlagKey = "update_directory"
Expand Down
7 changes: 7 additions & 0 deletions ee/agent/knapsack/knapsack.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ func (k *knapsack) UpdateDirectory() string {
return k.flags.UpdateDirectory()
}

func (k *knapsack) SetUseTUFAutoupdater(enabled bool) error {
return k.flags.SetUseTUFAutoupdater(enabled)
}
func (k *knapsack) UseTUFAutoupdater() bool {
return k.flags.UseTUFAutoupdater()
}

func (k *knapsack) SetExportTraces(enabled bool) error {
return k.flags.SetExportTraces(enabled)
}
Expand Down
4 changes: 4 additions & 0 deletions ee/agent/types/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ type Flags interface {
SetUpdateDirectory(directory string) error
UpdateDirectory() string

// UseTUFAutoupdater controls whether launcher uses the new TUF autoupdater instead of the legacy autoupdater
SetUseTUFAutoupdater(enabled bool) error
UseTUFAutoupdater() bool

// ExportTraces enables exporting our traces
SetExportTraces(enabled bool) error
SetExportTracesOverride(value bool, duration time.Duration)
Expand Down
28 changes: 28 additions & 0 deletions ee/agent/types/mocks/flags.go

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

28 changes: 28 additions & 0 deletions ee/agent/types/mocks/knapsack.go

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

Loading