RAM int64
Scratch int64
Price float64
- Preemptable bool
+ Preemptible bool
}
- // GetThisSystemNode returns a SystemNode for the node we're running
- // on right now.
- func (cc *Cluster) GetThisSystemNode() (*SystemNode, error) {
- hostname, err := os.Hostname()
- if err != nil {
- return nil, err
+ // GetNodeProfile returns a NodeProfile for the given hostname. An
+ // error is returned if the appropriate configuration can't be
+ // determined (e.g., this does not appear to be a system node). If
+ // node is empty, use the OS-reported hostname.
+ func (cc *Cluster) GetNodeProfile(node string) (*NodeProfile, error) {
+ if node == "" {
+ hostname, err := os.Hostname()
+ if err != nil {
+ return nil, err
+ }
+ node = hostname
}
- return cc.GetSystemNode(hostname)
- }
-
- // GetSystemNode returns a SystemNode for the given hostname. An error
- // is returned if the appropriate configuration can't be determined
- // (e.g., this does not appear to be a system node).
- func (cc *Cluster) GetSystemNode(node string) (*SystemNode, error) {
- if cfg, ok := cc.SystemNodes[node]; ok {
+ if cfg, ok := cc.NodeProfiles[node]; ok {
return &cfg, nil
}
// If node is not listed, but "*" gives a default system node