Skip to content

Commit

Permalink
Handle case where policy doesn't contain Fleet connection information.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse committed May 13, 2021
1 parent 52f2265 commit b273ee1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ func (h *PolicyChange) handleFleetServerHosts(ctx context.Context, c *config.Con
if len(h.setters) == 0 {
return nil
}
data, err := c.ToMapStr()
if err != nil {
return errors.New(err, "could not convert the configuration from the policy", errors.TypeConfig)
}
if _, ok := data["fleet"]; !ok {
// no fleet information in the configuration (skip checking client)
return nil
}

cfg, err := configuration.NewFromConfig(c)
if err != nil {
Expand Down

0 comments on commit b273ee1

Please sign in to comment.