Skip to content

Commit

Permalink
Only send landscape config task if we've made contact already
Browse files Browse the repository at this point in the history
Otherwise, the Landcape back-end cannot match the WSL distros to this
any agent.
  • Loading branch information
EduardGomezEscandell committed Oct 25, 2023
1 parent e85641d commit fc85d6f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions windows-agent/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,16 @@ func (c *Config) ProvisioningTasks(ctx context.Context, distroName string) ([]ta
proToken, _ := c.subscription()
taskList = append(taskList, tasks.ProAttachment{Token: proToken})

// Landcape registration
taskList = append(taskList, tasks.LandscapeConfigure{
Config: c.data.landscapeClientConfig,
HostagentUID: c.data.landscapeAgentUID,
})
if c.data.landscapeClientConfig == "" {
// Landscape unregistration: always
taskList = append(taskList, tasks.LandscapeConfigure{})
} else if c.data.landscapeAgentUID != "" {
// Landcape registration: only when we have a UID assigned
taskList = append(taskList, tasks.LandscapeConfigure{
Config: c.data.landscapeClientConfig,
HostagentUID: c.data.landscapeAgentUID,
})
}

return taskList, nil
}
Expand Down

0 comments on commit fc85d6f

Please sign in to comment.