Skip to content

Commit

Permalink
Clean up checks and rely on built in config fns
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Chapman committed Jun 14, 2023
1 parent 6fd48dd commit c70fe10
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions agent/config/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2545,12 +2545,10 @@ func (b *builder) cloudConfigVal(v Config) hcpconfig.CloudConfig {
val := hcpconfig.CloudConfig{
ResourceID: os.Getenv("HCP_RESOURCE_ID"),
}
if v.NodeName != nil {
val.NodeName = b.nodeName(v.NodeName)
}
if v.NodeID != nil {
val.NodeID = types.NodeID(stringVal(v.NodeID))
}

nodeID := stringVal(v.NodeID)
val.NodeID = types.NodeID(nodeID)
val.NodeName = b.nodeName(v.NodeName)

if v.Cloud == nil {
return val
Expand Down

0 comments on commit c70fe10

Please sign in to comment.