Skip to content

Commit 0595939

Browse files
abhilash-avcodycushing
authored andcommitted
Fix sweeper clean up CoreImage
1 parent fd4f30c commit 0595939

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

oci/core_image_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,11 @@ func getImageIds(compartment string) ([]string, error) {
279279
return resourceIds, fmt.Errorf("Error getting Image list for compartment id : %s , %s \n", compartmentId, err)
280280
}
281281
for _, image := range listImagesResponse.Items {
282-
id := *image.Id
283-
resourceIds = append(resourceIds, id)
284-
addResourceIdToSweeperResourceIdMap(compartmentId, "ImageId", id)
282+
if image.CompartmentId != nil && *image.CompartmentId == compartment && image.BaseImageId != nil {
283+
id := *image.Id
284+
resourceIds = append(resourceIds, id)
285+
addResourceIdToSweeperResourceIdMap(compartmentId, "ImageId", id)
286+
}
285287
}
286288
return resourceIds, nil
287289
}

0 commit comments

Comments
 (0)