From e6d4b8dd29a514bae202c66abd77817db9eb52c8 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:25:09 -0700 Subject: [PATCH] fix(containeranalysis): fix docs and closing of client. (#5220) It was documented that the embedded grafeas client shared a connection with the main client, but it does not and never has from looking at history. Updated the comment but also explicitly called close on the grafeas client when the containeranalysis client is closed. Fixes: #5217 --- containeranalysis/apiv1/container_analysis_client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/containeranalysis/apiv1/container_analysis_client.go b/containeranalysis/apiv1/container_analysis_client.go index b2f2cb70938..a24433d5321 100644 --- a/containeranalysis/apiv1/container_analysis_client.go +++ b/containeranalysis/apiv1/container_analysis_client.go @@ -110,9 +110,6 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error } // GetGrafeasClient returns a grafeas client connected to containeranalysis. -// -// Calling Close on either the grafeas or containeranalysis client will close -// the shared connection in both. func (c *Client) GetGrafeasClient() *grafeas.Client { return c.grafeasClient } @@ -124,7 +121,10 @@ func (c *Client) Connection() *grpc.ClientConn { // Close closes the connection to the API service. The user should invoke this when // the client is no longer required. +// +// Calling Close will also close the underlying grafeas client. func (c *Client) Close() error { + c.grafeasClient.Close() return c.connPool.Close() }