Skip to content

Commit

Permalink
fix: added TriggerAction
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Theuermann <[email protected]>
  • Loading branch information
mati007thm committed Dec 3, 2024
1 parent 3c5ae23 commit 8b5ff11
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/provider/integration_gitlab_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,18 @@ func (r *integrationGitlabResource) Create(ctx context.Context, req resource.Cre
)
return
}

// trigger integration to gather results quickly after the first setup
// NOTE: we ignore the error since the integration state does not depend on it
_, err = r.client.TriggerAction(ctx, string(integration.Mrn), mondoov1.ActionTypeRunScan)
if err != nil {
resp.Diagnostics.
AddWarning("Client Error",
fmt.Sprintf("Unable to trigger integration, got error: %s", err),
)
return
}

// Save space mrn into the Terraform state.
data.Mrn = types.StringValue(string(integration.Mrn))
data.Name = types.StringValue(data.Name.ValueString())
Expand Down

0 comments on commit 8b5ff11

Please sign in to comment.