mirror of
https://github.com/fleetdm/fleet
synced 2026-05-04 13:59:01 +00:00
* Add All Linux label
* Change name to Linux instead of All Linux to see if e2e likes it better
* Revert "Change name to Linux instead of All Linux to see if e2e likes it better"
This reverts commit 26b79f214e.
* Fix all linux label insert
36 lines
639 B
Go
36 lines
639 B
Go
package data
|
|
|
|
import (
|
|
"database/sql"
|
|
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
)
|
|
|
|
func init() {
|
|
MigrationClient.AddMigration(Up_20210806135609, Down_20210806135609)
|
|
}
|
|
|
|
func Up_20210806135609(tx *sql.Tx) error {
|
|
_, err := tx.Exec(`
|
|
INSERT INTO labels (
|
|
name,
|
|
description,
|
|
query,
|
|
platform,
|
|
label_type
|
|
) VALUES (?, ?, ?, ?, ?)`,
|
|
"All Linux", "All Linux distributions",
|
|
"SELECT 1 FROM osquery_info WHERE build_platform LIKE '%ubuntu%' OR build_distro LIKE '%centos%';",
|
|
"",
|
|
fleet.LabelTypeBuiltIn,
|
|
)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func Down_20210806135609(tx *sql.Tx) error {
|
|
return nil
|
|
}
|