9454522033
- Explicitly specify all of the valid options for fleet - Seperate the config from Units() - Add YAML tags for the fields
27 lines
589 B
Go
27 lines
589 B
Go
package system
|
|
|
|
import (
|
|
"github.com/coreos/coreos-cloudinit/config"
|
|
)
|
|
|
|
// Fleet is a top-level structure which embeds its underlying configuration,
|
|
// config.Fleet, and provides the system-specific Unit().
|
|
type Fleet struct {
|
|
config.Fleet
|
|
}
|
|
|
|
// Units generates a Unit file drop-in for fleet, if any fleet options were
|
|
// configured in cloud-config
|
|
func (fe Fleet) Units(_ string) ([]Unit, error) {
|
|
content := dropinContents(fe.Fleet)
|
|
if content == "" {
|
|
return nil, nil
|
|
}
|
|
return []Unit{{
|
|
Name: "fleet.service",
|
|
Runtime: true,
|
|
DropIn: true,
|
|
Content: content,
|
|
}}, nil
|
|
}
|