fleet/server/datastore/internal/appstate/labels.go
Zachary Wasserman 5371647d2c Add builtin labels via migration (#728)
Changing from the existing method of adding built in labels at server startup.
This new method should be friendlier to long term changes, and falls in line
with the new pattern established for osquery options.

Fixes #702
2017-01-06 12:30:43 -08:00

39 lines
1 KiB
Go

package appstate
import "github.com/kolide/kolide-ose/server/kolide"
// Labels is the set of builtin labels that should be populated in the
// datastore
func Labels() []kolide.Label {
return []kolide.Label{
{
Name: "All Hosts",
Query: "select 1;",
LabelType: kolide.LabelTypeBuiltIn,
},
{
Platform: "darwin",
Name: "Mac OS X",
Query: "select 1 from osquery_info where build_platform = 'darwin';",
LabelType: kolide.LabelTypeBuiltIn,
},
{
Platform: "ubuntu",
Name: "Ubuntu Linux",
Query: "select 1 from osquery_info where build_platform = 'ubuntu';",
LabelType: kolide.LabelTypeBuiltIn,
},
{
Platform: "centos",
Name: "CentOS Linux",
Query: "select 1 from osquery_info where build_platform = 'centos';",
LabelType: kolide.LabelTypeBuiltIn,
},
{
Platform: "windows",
Name: "MS Windows",
Query: "select 1 from osquery_info where build_platform = 'windows';",
LabelType: kolide.LabelTypeBuiltIn,
},
}
}