diff --git a/pkg/api/deploymentapi/search.go b/pkg/api/deploymentapi/search.go index 620d094a..1ccfe1c0 100644 --- a/pkg/api/deploymentapi/search.go +++ b/pkg/api/deploymentapi/search.go @@ -18,6 +18,7 @@ package deploymentapi import ( + "context" "errors" "github.com/elastic/cloud-sdk-go/pkg/api" @@ -31,6 +32,7 @@ import ( type SearchParams struct { *api.API + Context context.Context Request *models.SearchRequest } @@ -56,7 +58,8 @@ func Search(params SearchParams) (*models.DeploymentsSearchResponse, error) { res, err := params.V1API.Deployments.SearchDeployments( deployments.NewSearchDeploymentsParams(). - WithBody(params.Request), + WithBody(params.Request). + WithContext(params.Context), params.AuthWriter, ) if err != nil { diff --git a/pkg/plan/track_change.go b/pkg/plan/track_change.go index a63f1ab5..5ae2c08e 100644 --- a/pkg/plan/track_change.go +++ b/pkg/plan/track_change.go @@ -122,7 +122,8 @@ func getDeploymentID(params TrackChangeParams) (string, error) { res, err := params.V1API.Deployments.SearchDeployments( deployments.NewSearchDeploymentsParams(). - WithBody(LookupByResourceIdQuery(params.ResourceID)), + WithBody(LookupByResourceIdQuery(params.ResourceID)). + WithContext(params.Context), params.AuthWriter, ) if err != nil { diff --git a/pkg/plan/track_change_params.go b/pkg/plan/track_change_params.go index d23d8777..a05cacad 100644 --- a/pkg/plan/track_change_params.go +++ b/pkg/plan/track_change_params.go @@ -18,6 +18,7 @@ package plan import ( + "context" "errors" "time" @@ -31,6 +32,8 @@ import ( type TrackChangeParams struct { *api.API + Context context.Context + // DeploymentID to track its resource changes. Incompatible with ResourceID // and Kind. DeploymentID string