mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 02:45:42 +03:00
Adding the changes to structs
This commit is contained in:
@@ -1145,6 +1145,10 @@ func (sc *ServiceCheck) Hash(serviceId string) string {
|
||||
return fmt.Sprintf("%x", h.Sum(nil))
|
||||
}
|
||||
|
||||
const (
|
||||
NomadConsulPrefix = "nomad"
|
||||
)
|
||||
|
||||
// The Service model represents a Consul service defintion
|
||||
type Service struct {
|
||||
Id string // Id of the service, this needs to be unique on a local machine
|
||||
@@ -1157,7 +1161,7 @@ type Service struct {
|
||||
// InitFields interpolates values of Job, Task Group and Task in the Service
|
||||
// Name. This also generates check names, service id and check ids.
|
||||
func (s *Service) InitFields(job string, taskGroup string, task string) {
|
||||
s.Id = fmt.Sprintf("nomad-%s", GenerateUUID())
|
||||
s.Id = fmt.Sprintf("%s-%s", NomadConsulPrefix, GenerateUUID())
|
||||
s.Name = args.ReplaceEnv(s.Name, map[string]string{
|
||||
"JOB": job,
|
||||
"TASKGROUP": taskGroup,
|
||||
|
||||
Reference in New Issue
Block a user