Skip to content

Commit

Permalink
show id in ruleset data source
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunchauhanibm authored and hkantare committed Jul 11, 2024
1 parent 2a11fe9 commit d41a95b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func dataIBMCISRulesetEntrypointVersionsRead(d *schema.ResourceData, meta interf
rulesetOutput[CISRulesetsPhase] = *rulesetObj.Phase
rulesetOutput[CISRulesetsLastUpdatedAt] = *rulesetObj.LastUpdated
rulesetOutput[CISRulesetsVersion] = *rulesetObj.Version
rulesetOutput[CISRulesetsId] = *&rulesetObj.ID

rulesetList = append(rulesetList, rulesetOutput)

Expand All @@ -143,6 +144,7 @@ func dataIBMCISRulesetEntrypointVersionsRead(d *schema.ResourceData, meta interf
rulesetOutput[CISRulesetsPhase] = *rulesetObj.Phase
rulesetOutput[CISRulesetsLastUpdatedAt] = *rulesetObj.LastUpdated
rulesetOutput[CISRulesetsVersion] = *rulesetObj.Version
rulesetOutput[CISRulesetsId] = *&rulesetObj.ID

rulesetList = append(rulesetList, rulesetOutput)

Expand All @@ -167,7 +169,7 @@ func dataIBMCISRulesetEntrypointVersionsRead(d *schema.ResourceData, meta interf
rulesetObj := flattenCISRulesets(*result.Result)

d.SetId(dataSourceCISRulesetsCheckID(d))
d.Set(CISRulesetsListOutput, rulesetObj)
d.Set(CISRulesetsEntryPointOutput, rulesetObj)
d.Set(cisID, crn)

} else {
Expand All @@ -181,7 +183,7 @@ func dataIBMCISRulesetEntrypointVersionsRead(d *schema.ResourceData, meta interf
rulesetObj := flattenCISRulesets(*result.Result)

d.SetId(dataSourceCISRulesetsCheckID(d))
d.Set(CISRulesetsListOutput, rulesetObj)
d.Set(CISRulesetsEntryPointOutput, rulesetObj)
d.Set(cisID, crn)
}

Expand All @@ -198,7 +200,7 @@ func dataIBMCISRulesetEntrypointVersionsRead(d *schema.ResourceData, meta interf
rulesetObj := flattenCISRulesets(*result.Result)

d.SetId(dataSourceCISRulesetsCheckID(d))
d.Set(CISRulesetsListOutput, rulesetObj)
d.Set(CISRulesetsEntryPointOutput, rulesetObj)
d.Set(cisID, crn)

} else {
Expand All @@ -212,7 +214,7 @@ func dataIBMCISRulesetEntrypointVersionsRead(d *schema.ResourceData, meta interf
rulesetObj := flattenCISRulesets(*result.Result)

d.SetId(dataSourceCISRulesetsCheckID(d))
d.Set(CISRulesetsListOutput, rulesetObj)
d.Set(CISRulesetsEntryPointOutput, rulesetObj)
d.Set(cisID, crn)
}
}
Expand Down
1 change: 1 addition & 0 deletions ibm/service/cis/data_source_ibm_cis_rulesets.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ func flattenCISRulesets(rulesetObj rulesetsv1.RulesetDetails) interface{} {
rulesetOutput[CISRulesetsPhase] = *rulesetObj.Phase
rulesetOutput[CISRulesetsLastUpdatedAt] = *rulesetObj.LastUpdated
rulesetOutput[CISRulesetsVersion] = *rulesetObj.Version
rulesetOutput[CISRulesetsId] = *&rulesetObj.ID

ruleDetailsList := make([]map[string]interface{}, 0)
for _, ruleDetailsObj := range rulesetObj.Rules {
Expand Down

0 comments on commit d41a95b

Please sign in to comment.