Fix fleetctl preview bug caused by creating enroll secrets (#19497)

#19129

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [X] Manual QA for all new/changed functionality
This commit is contained in:
Lucas Manuel Rodriguez 2024-06-10 16:49:59 -03:00 committed by GitHub
parent 7eb3628fe6
commit a37d0692b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1 @@
* Fixed bug in `fleetctl preview` caused by creating enroll secrets.

View file

@ -407,8 +407,8 @@ Use the stop and reset subcommands to manage the server and dependencies once st
return fmt.Errorf("Error retrieving enroll secret: %w", err)
}
if len(secrets.Secrets) != 1 {
return errors.New("Expected 1 active enroll secret")
if len(secrets.Secrets) == 0 {
return errors.New("Expected at least one enroll secret")
}
// disable analytics collection for preview