Skip to content

Commit 12a924d

Browse files
committed
add comment explaining why we ignore the returned error
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
1 parent b49f753 commit 12a924d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/datagatherer/oidc/oidc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (g *DataGathererOIDC) fetchOIDCConfig(ctx context.Context) (map[string]any,
9494
return nil, fmt.Errorf("failed to get /.well-known/openid-configuration: %s", k8sErrorMessage(err))
9595
}
9696

97-
bytes, _ := result.Raw()
97+
bytes, _ := result.Raw() // we already checked result.Error(), so there is no error here
9898
var oidcResponse map[string]any
9999
if err := json.Unmarshal(bytes, &oidcResponse); err != nil {
100100
return nil, fmt.Errorf("failed to unmarshal OIDC discovery document: %v", err)
@@ -115,7 +115,7 @@ func (g *DataGathererOIDC) fetchJWKS(ctx context.Context) (map[string]any, error
115115
return nil, fmt.Errorf("failed to get /openid/v1/jwks: %s", k8sErrorMessage(err))
116116
}
117117

118-
bytes, _ := result.Raw()
118+
bytes, _ := result.Raw() // we already checked result.Error(), so there is no error here
119119
var jwksResponse map[string]any
120120
if err := json.Unmarshal(bytes, &jwksResponse); err != nil {
121121
return nil, fmt.Errorf("failed to unmarshal JWKS response: %v", err)

0 commit comments

Comments
 (0)