Skip to content

Commit

Permalink
tewsts.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Jun 15, 2024
1 parent 0a0f583 commit 3f6f0e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions integration-tests/registry_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ func TestRegistry(t *testing.T) {
Dependencies: &dependencies,
DownloadUrl: &downloadUrl,
Status: &nodeVersionStatus,
StatusReason: proto.String(""),
}, resVersions200[0], "should be equal")
})

Expand Down Expand Up @@ -664,6 +665,7 @@ func TestRegistry(t *testing.T) {
Dependencies: &dependencies,
DownloadUrl: &downloadUrl,
Status: &status,
StatusReason: proto.String(""),
}
assert.Equal(t, updatedNodeVersion, res200[0], "should be equal")
createdNodeVersion = res200[0]
Expand Down
6 changes: 5 additions & 1 deletion server/implementation/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,11 @@ func (s *DripStrictServerImplementation) AdminUpdateNodeVersion(
}

dbNodeVersion := mapper.ApiNodeVersionStatusToDbNodeVersionStatus(*request.Body.Status)
err = nodeVersion.Update().SetStatus(dbNodeVersion).SetStatusReason(*request.Body.StatusReason).Exec(ctx)
statusReason := ""
if request.Body.StatusReason != nil {
statusReason = *request.Body.StatusReason
}
err = nodeVersion.Update().SetStatus(dbNodeVersion).SetStatusReason(statusReason).Exec(ctx)
if err != nil {
log.Ctx(ctx).Error().Msgf("Failed to update node version w/ err: %v", err)
return drip.AdminUpdateNodeVersion500JSONResponse{}, err
Expand Down

0 comments on commit 3f6f0e4

Please sign in to comment.