Skip to content

Commit cda69f4

Browse files
authored
Merge pull request #6 from MustWin/image-query-display-name
Add display_name as an option for the image datasource
2 parents ee71aff + 39bb5f1 commit cda69f4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/image_datasource.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ func ImageDatasource() *schema.Resource {
2424
Type: schema.TypeString,
2525
Optional: true,
2626
},
27+
"display_name": {
28+
Type: schema.TypeString,
29+
Optional: true,
30+
},
2731
"operating_system": {
2832
Type: schema.TypeString,
2933
Optional: true,

core/image_datasource_crud.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ func (s *ImageDatasourceCrud) Get() (e error) {
2626
if val, ok := s.D.GetOk("operating_system_version"); ok {
2727
opts.OperatingSystemVersion = val.(string)
2828
}
29+
if val, ok := s.D.GetOk("display_name"); ok {
30+
opts.DisplayName = val.(string)
31+
}
2932

3033
s.Res = &baremetal.ListImages{Images: []baremetal.Image{}}
3134

0 commit comments

Comments
 (0)