diff --git a/agent/cmd/determined-agent/run.go b/agent/cmd/determined-agent/run.go index 02eecaa2418f..673a88d8c70f 100644 --- a/agent/cmd/determined-agent/run.go +++ b/agent/cmd/determined-agent/run.go @@ -49,7 +49,7 @@ func newRunCmd() *cobra.Command { return err } - opts, err = opts.ResolveHostname() + err = opts.SetAgentID() if err != nil { return err } diff --git a/agent/internal/options/options.go b/agent/internal/options/options.go index 772d02b1819e..28a5c1be51d4 100644 --- a/agent/internal/options/options.go +++ b/agent/internal/options/options.go @@ -29,36 +29,11 @@ func DefaultOptions() *Options { Level: "trace", Color: true, }, - MasterHost: "", - MasterPort: 0, - AgentID: "", - Label: "", - ResourcePool: "", - ContainerMasterHost: "", - ContainerMasterPort: 0, - SlotType: "auto", - VisibleGPUs: VisibleGPUsFromEnvironment(), - Security: SecurityOptions{ - TLS: TLSOptions{ - Enabled: false, - SkipVerify: false, - MasterCert: "", - MasterCertName: "", - }, - }, - Debug: false, - ArtificialSlots: 0, - ImageRoot: "", - TLS: false, - TLSCertFile: "", - TLSKeyFile: "", - APIEnabled: false, + + SlotType: "auto", + VisibleGPUs: VisibleGPUsFromEnvironment(), BindIP: "0.0.0.0", BindPort: 9090, - HTTPProxy: "", - HTTPSProxy: "", - FTPProxy: "", - NoProxy: "", AgentReconnectAttempts: aproto.AgentReconnectAttempts, AgentReconnectBackoff: int(aproto.AgentReconnectBackoff / time.Second), ContainerRuntime: DockerContainerRuntime, @@ -180,15 +155,15 @@ func (o *Options) Resolve() { } // ResolveHostname resolves the name (or ID) of the agent. -func (o *Options) ResolveHostname() (*Options, error) { +func (o *Options) SetAgentID() error { if o.AgentID == "" { hostname, hErr := os.Hostname() if hErr != nil { - return nil, hErr + return hErr } o.AgentID = hostname } - return o, nil + return nil } // SecurityOptions stores configurable security-related options.