Skip to content

Commit b918938

Browse files
committed
roachprod: fix ServiceDescriptor error handling
Previously, this could cause a panic if an error occurred while fetching the service descriptor. Now, it returns an error instead, and an empty ServiceDesc on error. Epic: None Release note: None
1 parent 5128b47 commit b918938

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/roachprod/install/cockroach.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ func (c *SyncedCluster) ServiceDescriptor(
519519
sqlInstance int,
520520
) (ServiceDesc, error) {
521521
services, err := c.ServiceDescriptors(ctx, Nodes{node}, virtualClusterName, serviceType, sqlInstance)
522+
if err != nil {
523+
return ServiceDesc{}, err
524+
}
522525
return services[0], err
523526
}
524527

0 commit comments

Comments
 (0)