mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 00:18:27 +00:00
24 lines
567 B
Go
24 lines
567 B
Go
package fleet
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
const ServerSecretPrefix = "FLEET_SECRET_"
|
|
|
|
type MissingSecretsError struct {
|
|
MissingSecrets []string
|
|
}
|
|
|
|
func (e MissingSecretsError) Error() string {
|
|
secretVars := make([]string, 0, len(e.MissingSecrets))
|
|
for _, secret := range e.MissingSecrets {
|
|
secretVars = append(secretVars, fmt.Sprintf("\"$%s%s\"", ServerSecretPrefix, secret))
|
|
}
|
|
plural := ""
|
|
if len(secretVars) > 1 {
|
|
plural = "s"
|
|
}
|
|
return fmt.Sprintf("Couldn't add. Secret variable%s %s missing from database", plural, strings.Join(secretVars, ", "))
|
|
}
|