Skip to content

Commit

Permalink
Populate Policy_id for integrations and policies when importing (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGkinis authored May 29, 2024
1 parent f45b085 commit c31de6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/fleet/agent_policy_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ func resourceAgentPolicyRead(ctx context.Context, d *schema.ResourceData, meta i
if err := d.Set("namespace", agentPolicy.Namespace); err != nil {
return diag.FromErr(err)
}
if err := d.Set("policy_id", agentPolicy.Id); err != nil {
return diag.FromErr(err)
}
if agentPolicy.Description != nil {
if err := d.Set("description", *agentPolicy.Description); err != nil {
return diag.FromErr(err)
Expand Down
3 changes: 3 additions & 0 deletions internal/fleet/integration_policy_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ func resourceIntegrationPolicyRead(ctx context.Context, d *schema.ResourceData,
if err := d.Set("namespace", pkgPolicy.Namespace); err != nil {
return diag.FromErr(err)
}
if err := d.Set("policy_id", pkgPolicy.Id); err != nil {
return diag.FromErr(err)
}
if err := d.Set("integration_name", pkgPolicy.Package.Name); err != nil {
return diag.FromErr(err)
}
Expand Down

0 comments on commit c31de6d

Please sign in to comment.