Skip to content

Commit

Permalink
Adding overload with instance name parameter. (bazelbuild#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ola Rozenfeld authored Jan 17, 2020
1 parent 75902a6 commit d02017f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion go/pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,14 @@ func (c *Client) GetBackendCapabilities(ctx context.Context, conn *grpc.ClientCo
// If the CAS URL was set differently to the execution server then the CacheCapabilities will
// be determined from that; ExecutionCapabilities will always come from the main URL.
func (c *Client) GetCapabilities(ctx context.Context) (res *repb.ServerCapabilities, err error) {
req := &repb.GetCapabilitiesRequest{InstanceName: c.InstanceName}
return c.GetCapabilitiesForInstance(ctx, c.InstanceName)
}

// GetCapabilitiesForInstance returns the capabilities for the targeted servers.
// If the CAS URL was set differently to the execution server then the CacheCapabilities will
// be determined from that; ExecutionCapabilities will always come from the main URL.
func (c *Client) GetCapabilitiesForInstance(ctx context.Context, instance string) (res *repb.ServerCapabilities, err error) {
req := &repb.GetCapabilitiesRequest{InstanceName: instance}
caps, err := c.GetBackendCapabilities(ctx, c.Connection, req)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion go/pkg/tree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func flattenTree(root digest.Digest, rootPath string, dirs map[digest.Digest]*re
}

// Check whether this is an empty directory.
if len(dir.Files) + len(dir.Directories) + len(dir.Symlinks) == 0 {
if len(dir.Files)+len(dir.Directories)+len(dir.Symlinks) == 0 {
flatFiles[flatDir.p] = &Output{
Path: flatDir.p,
IsEmptyDirectory: true,
Expand Down

0 comments on commit d02017f

Please sign in to comment.