From 509e1529299a3c822bbfb1d4487db2d49e089554 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Wed, 19 Aug 2020 21:01:47 -0400 Subject: [PATCH] command/agent/csi_endpoint: AllocID was missing, JobDescription --- command/agent/csi_endpoint.go | 4 ++-- command/agent/csi_endpoint_test.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/command/agent/csi_endpoint.go b/command/agent/csi_endpoint.go index d29e2e0e068f..1ef62750c4d9 100644 --- a/command/agent/csi_endpoint.go +++ b/command/agent/csi_endpoint.go @@ -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, } } @@ -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, diff --git a/command/agent/csi_endpoint_test.go b/command/agent/csi_endpoint_test.go index 5dc8ed5f6b80..064d13c62820 100644 --- a/command/agent/csi_endpoint_test.go +++ b/command/agent/csi_endpoint_test.go @@ -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) })