diff --git a/jobspec/test-fixtures/service-enable-tag-override.hcl b/jobspec/test-fixtures/service-enable-tag-override.hcl index 9143b8c34cd..78dde6168b0 100644 --- a/jobspec/test-fixtures/service-enable-tag-override.hcl +++ b/jobspec/test-fixtures/service-enable-tag-override.hcl @@ -1,9 +1,10 @@ job "service_eto" { type = "service" + group "group" { task "task" { service { - name = "example" + name = "example" enable_tag_override = true } } diff --git a/jobspec/test-fixtures/tg-service-enable-tag-override.hcl b/jobspec/test-fixtures/tg-service-enable-tag-override.hcl index a78ff66f995..451233d1ff6 100644 --- a/jobspec/test-fixtures/tg-service-enable-tag-override.hcl +++ b/jobspec/test-fixtures/tg-service-enable-tag-override.hcl @@ -1,7 +1,7 @@ job "group_service_eto" { group "group" { service { - name = "example" + name = "example" enable_tag_override = true } } diff --git a/nomad/core_sched.go b/nomad/core_sched.go index 01b7a0759e7..601e66fe492 100644 --- a/nomad/core_sched.go +++ b/nomad/core_sched.go @@ -769,7 +769,7 @@ func (c *CoreScheduler) volumeClaimReap(jobs []*structs.Job, leaderACL string) e continue } - gcAllocs := []*structs.Allocation{} + gcAllocs := []string{} // alloc IDs claimedNodes := map[string]struct{}{} knownNodes := []string{} @@ -790,7 +790,7 @@ func (c *CoreScheduler) volumeClaimReap(jobs []*structs.Job, leaderACL string) e claimedNodes[alloc.NodeID] = struct{}{} continue } - gcAllocs = append(gcAllocs, alloc) + gcAllocs = append(gcAllocs, alloc.ID) } } @@ -798,9 +798,9 @@ func (c *CoreScheduler) volumeClaimReap(jobs []*structs.Job, leaderACL string) e collectFunc(vol.ReadAllocs) req := &structs.CSIVolumeClaimRequest{ - VolumeID: volID, - Allocation: nil, // controller unpublish never uses this field - Claim: structs.CSIVolumeClaimRelease, + VolumeID: volID, + AllocationID: "", // controller unpublish never uses this field + Claim: structs.CSIVolumeClaimRelease, WriteRequest: structs.WriteRequest{ Region: job.Region, Namespace: job.Namespace, @@ -822,8 +822,8 @@ func (c *CoreScheduler) volumeClaimReap(jobs []*structs.Job, leaderACL string) e } } - for _, alloc := range gcAllocs { - req.Allocation = alloc + for _, allocID := range gcAllocs { + req.AllocationID = allocID err = c.srv.RPC("CSIVolume.Claim", req, &structs.CSIVolumeClaimResponse{}) if err != nil { c.logger.Error("volume claim release failed", "error", err)