Skip to content

Commit

Permalink
🧹 fix warning in gql client (#2987)
Browse files Browse the repository at this point in the history
* fix warning in gql client

Signed-off-by: Ivan Milchev <[email protected]>

* fix build

Signed-off-by: Ivan Milchev <[email protected]>

---------

Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Jan 9, 2024
1 parent 8651d80 commit b3e6624
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion providers-sdk/v1/upstream/gql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type MondooClient struct {

// NewClient creates a new GraphQL client for the Mondoo API
// provide the http client used for rpc, to also pass in the proxy settings
func NewClient(upstream upstream.UpstreamConfig, httpClient *http.Client) (*MondooClient, error) {
func NewClient(upstream *upstream.UpstreamConfig, httpClient *http.Client) (*MondooClient, error) {
gqlEndpoint := upstream.ApiEndpoint + "/query"
creds, err := json.Marshal(upstream.Creds)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion providers/os/resources/asset_vuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func getAdvisoryReport(runtime *plugin.Runtime) (*mvd.VulnReport, error) {
}

// get new gql client
mondooClient, err := gql.NewClient(mcc.UpstreamConfig, mcc.HttpClient)
mondooClient, err := gql.NewClient(&mcc.UpstreamConfig, mcc.HttpClient)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions providers/os/resources/vulnmgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (v *mqlVulnmgmt) lastAssessment() (*time.Time, error) {
mondooClient = v.gqlClient
} else {
// get new gql client
mondooClient, err = gql.NewClient(mcc.UpstreamConfig, mcc.HttpClient)
mondooClient, err = gql.NewClient(&mcc.UpstreamConfig, mcc.HttpClient)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -203,7 +203,7 @@ func (v *mqlVulnmgmt) getReport() (*gql.VulnReport, error) {
mondooClient = v.gqlClient
} else {
// get new gql client
mondooClient, err = gql.NewClient(mcc.UpstreamConfig, mcc.HttpClient)
mondooClient, err = gql.NewClient(&mcc.UpstreamConfig, mcc.HttpClient)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions providers/vsphere/resources/vulnmgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (v *mqlVulnmgmt) lastAssessment() (*time.Time, error) {
mondooClient = v.gqlClient
} else {
// get new gql client
mondooClient, err = gql.NewClient(mcc.UpstreamConfig, mcc.HttpClient)
mondooClient, err = gql.NewClient(&mcc.UpstreamConfig, mcc.HttpClient)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -176,7 +176,7 @@ func (v *mqlVulnmgmt) getReport() (*gql.VulnReport, error) {
mondooClient = v.gqlClient
} else {
// get new gql client
mondooClient, err = gql.NewClient(mcc.UpstreamConfig, mcc.HttpClient)
mondooClient, err = gql.NewClient(&mcc.UpstreamConfig, mcc.HttpClient)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b3e6624

Please sign in to comment.