@@ -24,18 +24,9 @@ func (c *FleetClient) Units(target string) (units []string, err error) {
2424 if err != nil {
2525 return
2626 }
27- if strings .HasSuffix (target , "-data" ) {
28- for _ , u := range allUnits {
29- if strings .Contains (u .Name , target ) {
30- units = []string {u .Name }
31- return
32- }
33- }
34- } else {
35- for _ , u := range allUnits {
36- if strings .Contains (u .Name , target ) && ! strings .HasSuffix (u .Name , "-data.service" ) {
37- units = append (units , u .Name )
38- }
27+ for _ , u := range allUnits {
28+ if strings .Contains (u .Name , target ) {
29+ units = append (units , u .Name )
3930 }
4031 }
4132 if len (units ) == 0 {
@@ -84,22 +75,6 @@ func NewUnit(component string) (uf *unit.UnitFile, err error) {
8475 return
8576}
8677
87- // NewDataUnit takes a component type and returns a Fleet unit
88- // that is hard-scheduled to a machine ID
89- func NewDataUnit (component string , machineID string ) (uf * unit.UnitFile , err error ) {
90- template , err := readTemplate (component )
91- if err != nil {
92- return
93- }
94- // replace CHANGEME with random machineID
95- replaced := strings .Replace (string (template ), "CHANGEME" , machineID , 1 )
96- uf , err = unit .NewUnitFile (replaced )
97- if err != nil {
98- return
99- }
100- return
101- }
102-
10378// formatUnitName returns a properly formatted systemd service name
10479// using the given component type and number
10580func formatUnitName (component string , num int ) (unitName string , err error ) {
0 commit comments