Skip to content

Commit

Permalink
style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
amandavialva01 committed Feb 6, 2024
1 parent 05af106 commit f30ad13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
2 changes: 1 addition & 1 deletion agent/cmd/determined-agent/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func newRunCmd() *cobra.Command {
return err
}

opts, err = opts.ResolveHostname()
err = opts.SetAgentID()
if err != nil {
return err
}
Expand Down
37 changes: 6 additions & 31 deletions agent/internal/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit f30ad13

Please sign in to comment.