Skip to content

Commit 6eb2712

Browse files
authored
direct: Add test for remote reference resulting in permanent drift (#3858)
1 parent 9747414 commit 6eb2712

15 files changed

+162
-50
lines changed

acceptance/bundle/resource_deps/remote_field_storage_location/databricks.yml.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ resources:
1212
catalog_name: main
1313
schema_name: myschema-${UNIQUE_NAME}
1414
name: volumebar-${UNIQUE_NAME}
15+
1516
foo:
1617
catalog_name: main
1718
schema_name: myschema-${UNIQUE_NAME}
1819
name: volumefoo-${UNIQUE_NAME}
19-
storage_location: ${resources.volumes.bar.storage_location}
20+
comment: ${resources.volumes.bar.storage_location}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
>>> errcode [CLI] bundle deploy
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/testbundle-[UNIQUE_NAME]/default/files...
4+
Deploying resources...
5+
Updating deployment state...
6+
Deployment complete!
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"method": "POST",
3+
"path": "/api/2.1/unity-catalog/schemas",
4+
"body": {
5+
"catalog_name": "main",
6+
"name": "myschema-[UNIQUE_NAME]"
7+
}
8+
}
9+
{
10+
"method": "POST",
11+
"path": "/api/2.1/unity-catalog/volumes",
12+
"body": {
13+
"catalog_name": "main",
14+
"name": "volumebar-[UNIQUE_NAME]",
15+
"schema_name": "myschema-[UNIQUE_NAME]",
16+
"volume_type": "MANAGED"
17+
}
18+
}
19+
{
20+
"method": "POST",
21+
"path": "/api/2.1/unity-catalog/volumes",
22+
"body": {
23+
"catalog_name": "main",
24+
"comment": "s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]",
25+
"name": "volumefoo-[UNIQUE_NAME]",
26+
"schema_name": "myschema-[UNIQUE_NAME]",
27+
"volume_type": "MANAGED"
28+
}
29+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"method": "POST",
3+
"path": "/api/2.1/unity-catalog/schemas",
4+
"body": {
5+
"catalog_name": "main",
6+
"name": "myschema-[UNIQUE_NAME]"
7+
}
8+
}
9+
{
10+
"method": "GET",
11+
"path": "/api/2.1/unity-catalog/schemas/main.myschema-[UNIQUE_NAME]"
12+
}
13+
{
14+
"method": "POST",
15+
"path": "/api/2.1/unity-catalog/volumes",
16+
"body": {
17+
"catalog_name": "main",
18+
"name": "volumebar-[UNIQUE_NAME]",
19+
"schema_name": "myschema-[UNIQUE_NAME]",
20+
"volume_type": "MANAGED"
21+
}
22+
}
23+
{
24+
"method": "GET",
25+
"path": "/api/2.1/unity-catalog/volumes/main.myschema-[UNIQUE_NAME].volumebar-[UNIQUE_NAME]"
26+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
>>> errcode [CLI] bundle deploy
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/testbundle-[UNIQUE_NAME]/default/files...
4+
Deploying resources...
5+
Error: terraform apply: exit status 1
6+
7+
Error: Provider produced inconsistent final plan
8+
9+
When expanding the plan for databricks_volume.foo to include new values
10+
learned so far during apply, provider
11+
"registry.terraform.io/databricks/databricks" produced an invalid new value
12+
for .comment: was null, but now
13+
cty.StringVal("s3://deco-uc-prod-isolated-aws-us-east-1/metastore/[UUID]/volumes/[UUID]").
14+
15+
This is a bug in the provider, which should be reported in the provider's own
16+
issue tracker.
17+
18+
19+
Updating deployment state...
20+
21+
Exit code: 1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The following resources will be deleted:
2+
delete schema my
3+
delete volume bar
4+
delete volume foo
5+
6+
This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
7+
delete schema my
8+
9+
This action will result in the deletion of the following volumes.
10+
For managed volumes, the files stored in the volume are also deleted from your
11+
cloud tenant within 30 days. For external volumes, the metadata about the volume
12+
is removed from the catalog, but the underlying files are not deleted:
13+
delete volume bar
14+
delete volume foo
15+
16+
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/testbundle-[UNIQUE_NAME]/default
17+
18+
Deleting files...
19+
Destroy complete!
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
The following resources will be deleted:
2+
delete schema my
3+
delete volume bar
4+
5+
This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
6+
delete schema my
7+
8+
This action will result in the deletion of the following volumes.
9+
For managed volumes, the files stored in the volume are also deleted from your
10+
cloud tenant within 30 days. For external volumes, the metadata about the volume
11+
is removed from the catalog, but the underlying files are not deleted:
12+
delete volume bar
13+
14+
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/testbundle-[UNIQUE_NAME]/default
15+
16+
Deleting files...
17+
Destroy complete!
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"method": "DELETE",
3+
"path": "/api/2.1/unity-catalog/schemas/main.myschema-[UNIQUE_NAME]",
4+
"q": {
5+
"force": "true"
6+
}
7+
}
8+
{
9+
"method": "DELETE",
10+
"path": "/api/2.1/unity-catalog/volumes/main.myschema-[UNIQUE_NAME].volumebar-[UNIQUE_NAME]"
11+
}
12+
{
13+
"method": "DELETE",
14+
"path": "/api/2.1/unity-catalog/volumes/main.myschema-[UNIQUE_NAME].volumefoo-[UNIQUE_NAME]"
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"method": "DELETE",
3+
"path": "/api/2.1/unity-catalog/schemas/main.myschema-[UNIQUE_NAME]",
4+
"q": {
5+
"force": "true"
6+
}
7+
}
8+
{
9+
"method": "DELETE",
10+
"path": "/api/2.1/unity-catalog/volumes/main.myschema-[UNIQUE_NAME].volumebar-[UNIQUE_NAME]"
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
update volumes.foo
2+
3+
Plan: 0 to add, 1 to change, 0 to delete, 2 unchanged

0 commit comments

Comments
 (0)