diff --git a/pkg/osquery/enrollment_details.go b/pkg/osquery/enrollment_details.go index 283e4ec65..a8382bfef 100644 --- a/pkg/osquery/enrollment_details.go +++ b/pkg/osquery/enrollment_details.go @@ -19,6 +19,8 @@ import ( "github.com/pkg/errors" ) +// getEnrollDetails returns an EnrollmentDetails struct with populated with details it can fetch without osquery. +// To get the rest of the details, pass the struct to getOsqEnrollDetails. func getRuntimeEnrollDetails() service.EnrollmentDetails { details := service.EnrollmentDetails{ OSPlatform: runtime.GOOS, @@ -47,6 +49,8 @@ func getRuntimeEnrollDetails() service.EnrollmentDetails { return details } +// getOsqEnrollDetails queries osquery for enrollment details and populates the EnrollmentDetails struct. +// It's expected that the caller has initially populated the struct with runtimeEnrollDetails by calling getRuntimeEnrollDetails. func getOsqEnrollDetails(ctx context.Context, osquerydPath string, details *service.EnrollmentDetails) error { ctx, span := traces.StartSpan(ctx) defer span.End()