Skip to content

Commit e140a58

Browse files
authored
Merge pull request #77 from philips-software/feature/79
Implement force_delete
2 parents cb9b2d9 + 40d3dcd commit e140a58

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

.github/workflows/goreleaser.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ jobs:
1616
uses: actions/setup-go@v2
1717
with:
1818
stable: false
19-
go-version: '1.16.0'
19+
go-version: '1.16.3'
20+
-
21+
name: Go test
22+
run: go test ./...
2023
-
2124
name: Run GoReleaser
2225
uses: goreleaser/goreleaser-action@v2

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
6+
## v0.15.0
7+
- Refactor and announce `hsdp_function` beta status
8+
- Filter out sensitive fields from debug logs
9+
- Add support for `ferrite` backend for `hsdp_function`
10+
- DICOM Object stores are soft deleted by default, with option to `force_delete`
11+
612
## v0.14.8
713
- Extra validation for `hsdp_iam_service`
814
- Format generated IAM Service PEM key to be more parser friendly (#72)

docs/resources/dicom_object_store.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ resource "hsdp_dicom_object_store" "store2" {
5656
* `name` - (Optional) Name of the service
5757
* `access_token_endpoint` - (Optional) The IAM access token endpoint
5858
* `token_endpoint` - (Optional) The IAM token endpoint
59+
* `force_delete` - (Optional) By default object stores are not deleted by the provider (soft-delete).
60+
By setting this value to `true` the provider removes object stores. We strongly sugges to enable this only for ephemeral deployments.
61+
5962

6063
# Attribute reference
6164
* `access_type` - The access type for this object store

hsdp/resource_dicom_object_store.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func resourceDICOMObjectStore() *schema.Resource {
1717
CreateContext: resourceDICOMObjectStoreCreate,
1818
ReadContext: resourceDICOMObjectStoreRead,
1919
DeleteContext: resourceDICOMObjectStoreDelete,
20+
SchemaVersion: 1,
2021

2122
Schema: map[string]*schema.Schema{
2223
"config_url": {
@@ -34,6 +35,12 @@ func resourceDICOMObjectStore() *schema.Resource {
3435
Optional: true,
3536
ForceNew: true,
3637
},
38+
"force_delete": {
39+
Type: schema.TypeBool,
40+
Optional: true,
41+
Default: false,
42+
ForceNew: true,
43+
},
3744
"static_access": {
3845
Type: schema.TypeSet,
3946
Optional: true,
@@ -133,11 +140,16 @@ func resourceDICOMObjectStoreDelete(_ context.Context, d *schema.ResourceData, m
133140
config := m.(*Config)
134141
configURL := d.Get("config_url").(string)
135142
orgID := d.Get("organization_id").(string)
143+
forceDelete := d.Get("force_delete").(bool)
136144
client, err := config.getDICOMConfigClient(configURL)
137145
if err != nil {
138146
return diag.FromErr(err)
139147
}
140148
defer client.Close()
149+
if !forceDelete { // soft delete
150+
d.SetId("")
151+
return diags
152+
}
141153
operation := func() error {
142154
var resp *dicom.Response
143155
_, resp, err = client.Config.DeleteObjectStore(dicom.ObjectStore{ID: d.Id()}, &dicom.QueryOptions{

0 commit comments

Comments
 (0)