github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/client/fingerprint/arch.go (about)

     1  package fingerprint
     2  
     3  import (
     4  	"log"
     5  	"runtime"
     6  
     7  	client "github.com/hashicorp/nomad/client/config"
     8  	"github.com/hashicorp/nomad/nomad/structs"
     9  )
    10  
    11  // ArchFingerprint is used to fingerprint the architecture
    12  type ArchFingerprint struct {
    13  	StaticFingerprinter
    14  	logger *log.Logger
    15  }
    16  
    17  // NewArchFingerprint is used to create an OS fingerprint
    18  func NewArchFingerprint(logger *log.Logger) Fingerprint {
    19  	f := &ArchFingerprint{logger: logger}
    20  	return f
    21  }
    22  
    23  func (f *ArchFingerprint) Fingerprint(config *client.Config, node *structs.Node) (bool, error) {
    24  	node.Attributes["cpu.arch"] = runtime.GOARCH
    25  	return true, nil
    26  }