open-nomad/client/fingerprint/arch.go

26 lines
586 B
Go
Raw Normal View History

2015-08-20 23:29:19 +00:00
package fingerprint
import (
"log"
"runtime"
client "github.com/hashicorp/nomad/client/config"
2015-08-20 23:29:19 +00:00
"github.com/hashicorp/nomad/nomad/structs"
)
// ArchFingerprint is used to fingerprint the architecture
type ArchFingerprint struct {
logger *log.Logger
}
// NewArchFingerprint is used to create an OS fingerprint
func NewArchFingerprint(logger *log.Logger) Fingerprint {
f := &ArchFingerprint{logger: logger}
2015-08-20 23:29:19 +00:00
return f
}
func (f *ArchFingerprint) Fingerprint(config *client.Config, node *structs.Node) (bool, error) {
2015-08-20 23:29:19 +00:00
node.Attributes["arch"] = runtime.GOARCH
return true, nil
}