Skip to content

Commit

Permalink
command/agent/csi_endpoint: AllocID was missing, JobDescription
Browse files Browse the repository at this point in the history
  • Loading branch information
langmartin committed Aug 21, 2020
1 parent 6266f48 commit 509e152
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions command/agent/csi_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,8 @@ func structsCSIPluginToApi(plug *structs.CSIPlugin) *api.CSIPlugin {
func structsJobDescriptionToApi(desc structs.JobDescription) api.JobDescription {
return api.JobDescription{
Namespace: desc.Namespace,
JobID: desc.JobID,
ID: desc.ID,
Version: desc.Version,
Expected: desc.Expected,
}
}

Expand Down Expand Up @@ -378,6 +377,7 @@ func structsCSIInfoToApi(info *structs.CSIInfo) *api.CSIInfo {
}
out := &api.CSIInfo{
PluginID: info.PluginID,
AllocID: info.AllocID,
Healthy: info.Healthy,
HealthDescription: info.HealthDescription,
UpdateTime: info.UpdateTime,
Expand Down
5 changes: 3 additions & 2 deletions command/agent/csi_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ func TestHTTP_CSIEndpointPlugin(t *testing.T) {
out, ok := obj.(*api.CSIPlugin)
require.True(t, ok)

require.Equal(t, 1, out.ControllersExpected)
// ControllersExpected is 0 because this plugin was created without a job,
// which sets expected
require.Equal(t, 0, out.ControllersExpected)
require.Equal(t, 1, out.ControllersHealthy)
require.Len(t, out.Controllers, 1)

require.Equal(t, 2, out.NodesExpected)
require.Equal(t, 2, out.NodesHealthy)
require.Len(t, out.Nodes, 2)
})
Expand Down

0 comments on commit 509e152

Please sign in to comment.