Skip to content

Commit

Permalink
Autoupdate documentation cleanup (#1572)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Feb 14, 2024
1 parent b298692 commit a0eb0b9
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 25 deletions.
3 changes: 1 addition & 2 deletions cmd/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,8 @@ func runLauncher(ctx context.Context, cancel func(), multiSlogger, systemMultiSl
runGroup.Add("localserver", ls.Start, ls.Interrupt)
}

// If autoupdating is enabled, run the new autoupdater
// If autoupdating is enabled, run the autoupdater
if k.Autoupdate() {
// Create a new TUF autoupdater
metadataClient := http.DefaultClient
metadataClient.Timeout = 30 * time.Second
mirrorClient := http.DefaultClient
Expand Down
8 changes: 0 additions & 8 deletions cmd/launcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ func main() {
ctx = ctxlog.NewContext(ctx, logger)

// If there's a newer version of launcher on disk, use it.
// This does not call DeleteOldUpdates, on the theory that
// it's better left to the service to handle cleanup. This is
// a straight forward exec.
//
// launcher is _also_ called when we're checking update
// validity (with autoupdate.checkExecutable). This is
// somewhat awkward as we end up with extra call layers.
//
// Allow a caller to set `LAUNCHER_SKIP_UPDATES` as a way to
// skip exec'ing an update. This helps prevent launcher from
// fork-bombing itself. This is an ENV, because there's no
Expand Down
2 changes: 1 addition & 1 deletion cmd/launcher/signal_listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestInterrupt_Multiple(t *testing.T) {
_, cancel := context.WithCancel(context.TODO())
sigListener := newSignalListener(sigChannel, cancel, log.NewNopLogger())

// Let the autoupdater run for a bit
// Let the signal listener run for a bit
go sigListener.Execute()
time.Sleep(3 * time.Second)
sigListener.Interrupt(errors.New("test error"))
Expand Down
1 change: 0 additions & 1 deletion cmd/make/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
func main() {
buildAll := strings.Join([]string{
"deps-go",
"install-tools",
}, ",")

fs := flag.NewFlagSet("make", flag.ExitOnError)
Expand Down
2 changes: 1 addition & 1 deletion ee/agent/types/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type Flags interface {
SetTufServerURL(url string) error
TufServerURL() string

// MirrorServerURL is the URL for the Notary mirror.
// MirrorServerURL is the URL for the TUF mirror.
SetMirrorServerURL(url string) error
MirrorServerURL() string

Expand Down
6 changes: 3 additions & 3 deletions ee/tuf/autoupdate.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Package tuf provides an autoupdater that uses our new TUF infrastructure,
// replacing the previous Notary-based implementation. It allows launcher to
// download new launcher and osqueryd binaries.
package tuf

// This new autoupdater points to our new TUF infrastructure, and will eventually supersede
// the legacy `Updater` in pkg/autoupdate that points to Notary.

import (
"context"
_ "embed"
Expand Down
1 change: 0 additions & 1 deletion ee/tuf/library_lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type autoupdateConfig struct {

// CheckOutLatestWithoutConfig returns information about the latest downloaded executable for our binary,
// searching for launcher configuration values in its config file.
// For now, it is only available when launcher is on the nightly update channel.
func CheckOutLatestWithoutConfig(binary autoupdatableBinary, logger log.Logger) (*BinaryUpdateInfo, error) {
logger = log.With(logger, "component", "tuf_library_lookup")
cfg, err := getAutoupdateConfig(os.Args[1:])
Expand Down
4 changes: 1 addition & 3 deletions pkg/autoupdate/autoupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ func SanitizeUpdateChannel(value string) string {
}

const (
DefaultMirror = "https://dl.kolide.co"
DefaultNotary = "https://notary.kolide.co"
DefaultNotaryPrefix = "kolide"
DefaultMirror = "https://dl.kolide.co"
)
8 changes: 3 additions & 5 deletions pkg/launcher/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type Options struct {
Autoupdate bool
// TufServerURL is the URL for the tuf server.
TufServerURL string
// MirrorServerURL is the URL for the Notary mirror.
// MirrorServerURL is the URL for the TUF mirror.
MirrorServerURL string
// AutoupdateInterval is the interval at which Launcher will check for
// updates.
Expand Down Expand Up @@ -265,8 +265,8 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
_ = flagset.Bool("control", false, "DEPRECATED")
_ = flagset.String("control_hostname", "", "DEPRECATED")
_ = flagset.Bool("disable_control_tls", false, "DEPRECATED")
_ = flagset.String("notary_url", autoupdate.DefaultNotary, "DEPRECATED")
_ = flagset.String("notary_prefix", autoupdate.DefaultNotaryPrefix, "DEPRECATED")
_ = flagset.String("notary_url", "", "DEPRECATED")
_ = flagset.String("notary_prefix", "", "DEPRECATED")
)

flagset.Var(&flOsqueryFlags, "osquery_flag", "Flags to pass to osquery (possibly overriding Launcher defaults)")
Expand Down Expand Up @@ -505,11 +505,9 @@ func developerUsage(flagset *flag.FlagSet) {
fmt.Fprintf(os.Stderr, "\n")
printOpt("logging_interval")
fmt.Fprintf(os.Stderr, "\n")
printOpt("notary_url")
printOpt("mirror_url")
printOpt("autoupdate_interval")
printOpt("update_channel")
printOpt("notary_prefix")
fmt.Fprintf(os.Stderr, "\n")
printOpt("control_get_shells_interval")
fmt.Fprintf(os.Stderr, "\n")
Expand Down

0 comments on commit a0eb0b9

Please sign in to comment.