Skip to content

Commit d0940ab

Browse files
authored
Remove databricks_mount import from docs (#1020)
This PR removes documentation references and `exporter` generation for things, that have never been properly working. Generic solution for importing mounts is not possible in the current implementation of mounts, that rely on Command/Context APIs. Fix #1018
1 parent b238617 commit d0940ab

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

docs/resources/mount.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,3 @@ In addition to all arguments above, the following attributes are exported:
327327

328328
* `id` - mount name
329329
* `source` - (String) HDFS-compatible url
330-
331-
## Import
332-
333-
The resource can be imported using it's mount name
334-
335-
```bash
336-
$ terraform import databricks_mount.this <mount_name>
337-
```

exporter/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (ic *importContext) Run() error {
222222
if i%50 == 0 {
223223
log.Printf("[INFO] Generated %d of %d resources", i, scopeSize)
224224
}
225-
if r.Mode != "data" {
225+
if r.Mode != "data" && ic.Resources[r.Resource].Importer != nil {
226226
// nolint
227227
sh.WriteString(r.ImportCommand(ic) + "\n")
228228
}

provider/provider_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,3 @@ func configureProviderAndReturnClient(t *testing.T, tt providerFixture) (*common
403403

404404
return client, nil
405405
}
406-
407-
func TestAllResourcesMustHaveImport(t *testing.T) {
408-
p := DatabricksProvider()
409-
for name, r := range p.ResourcesMap {
410-
if r.Importer == nil {
411-
assert.Fail(t, "Missing importer: %s", name)
412-
}
413-
}
414-
}

storage/resource_mount.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ func ResourceMount() *schema.Resource {
6363
r.CreateContext = mountCallback(mountCreate).preProcess(r)
6464
r.ReadContext = mountCallback(mountRead).preProcess(r)
6565
r.DeleteContext = mountCallback(mountDelete).preProcess(r)
66+
r.Importer = nil
6667
return r
6768
}

0 commit comments

Comments
 (0)