Skip to content

Commit

Permalink
IF-8978 delete visibility default value of Image (#111)
Browse files Browse the repository at this point in the history
* IF-8978 delete visibility default value of Image
  • Loading branch information
ikegami-shota authored Jan 18, 2024
1 parent f0b8873 commit e859a0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions ecl/data_source_ecl_imagestorages_image_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ resource "ecl_imagestorages_image_v2" "image_1" {
foo = "bar"
bar = "foo"
}
visibility = "private"
}
`, localFileForDataSourceTest)
Expand Down
7 changes: 5 additions & 2 deletions ecl/resource_ecl_imagestorages_image_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func resourceImageStoragesImageV2() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ValidateFunc: resourceImageStoragesImageV2ValidateVisibility,
Default: "private",
Computed: true,
},

"properties": &schema.Schema{
Expand Down Expand Up @@ -186,7 +186,6 @@ func resourceImageStoragesImageV2Create(d *schema.ResourceData, meta interface{}
MinDisk: d.Get("min_disk_gb").(int),
MinRAM: d.Get("min_ram_mb").(int),
Protected: &protected,
Visibility: &visibility,
Properties: imageProperties,
}

Expand All @@ -195,6 +194,10 @@ func resourceImageStoragesImageV2Create(d *schema.ResourceData, meta interface{}
createOpts.Tags = resourceImageStoragesImageV2BuildTags(tags)
}

if visibility != "" {
createOpts.Visibility = &visibility
}

d.Partial(true)

log.Printf("[DEBUG] Create Options: %#v", createOpts)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/imagestorages_image_v2.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following arguments are supported:

* `verify_checksum` - (Optional) If false, the checksum will not be verified once the image is finished uploading. Defaults to true.

* `visibility` - (Optional) Scope of image accessibility. Must be one of "public", "private". Defaults to "private".
* `visibility` - (Optional) Scope of image accessibility. Must be one of "public", "private", "shared".

* `peroperties` - (Optional) A map of key/value pairs to set freeform information about an image.

Expand Down

0 comments on commit e859a0c

Please sign in to comment.