Skip to content

Commit 357f298

Browse files
committed
fix: pass request to UpdateAttestedNode RPC
1 parent bca9469 commit 357f298

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pkg/connect/client/datastore/v1alpha1/datastore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (c *datastoreClient) FetchAttestedNode(ctx context.Context, req *datastorev
8585
}
8686

8787
func (c *datastoreClient) UpdateAttestedNode(ctx context.Context, req *datastorev1alpha1.UpdateAttestedNodeRequest) (*datastorev1alpha1.UpdateAttestedNodeResponse, error) {
88-
resp, err := c.client.UpdateAttestedNode(ctx, &datastorev1alpha1.UpdateAttestedNodeRequest{})
88+
resp, err := c.client.UpdateAttestedNode(ctx, req)
8989
if err != nil {
9090
return nil, err
9191
}

pkg/connect/client/datastore/v1alpha1/datastore_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ func TestDataStoreClient(t *testing.T) {
8787
require.NoError(t, err)
8888
assert.EqualExportedValues(t, []*datastorev1alpha1.AttestedNode{node}, listResp.Nodes)
8989

90+
// Test UpdateAttestedNode
91+
updateResp, err := client.UpdateAttestedNode(ctx, &datastorev1alpha1.UpdateAttestedNodeRequest{Node: node})
92+
require.NoError(t, err)
93+
assert.EqualExportedValues(t, node, updateResp.Node)
94+
9095
// Test GetNodeSelectors
9196
selectors := fakeNodeSelectors()
9297
getSelectorsResp, err := client.GetNodeSelectors(ctx, &datastorev1alpha1.GetNodeSelectorsRequest{SpiffeId: fakeSpiffeID})
@@ -143,6 +148,7 @@ func (f *fakeDataStoreService) ListAttestedNodes(ctx context.Context, req *datas
143148
}
144149

145150
func (f *fakeDataStoreService) UpdateAttestedNode(ctx context.Context, req *datastorev1alpha1.UpdateAttestedNodeRequest) (*datastorev1alpha1.UpdateAttestedNodeResponse, error) {
151+
assert.Equal(f.t, fakeAttestedNode(), req.Node)
146152
return &datastorev1alpha1.UpdateAttestedNodeResponse{Node: req.Node}, nil
147153
}
148154

0 commit comments

Comments
 (0)