Skip to content

Commit 5f6c2cc

Browse files
committed
do not drop allow_duplicate_names field from the pipeline resource
1 parent aa5268a commit 5f6c2cc

File tree

6 files changed

+6
-16
lines changed

6 files changed

+6
-16
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
### CLI
1010

1111
### Bundles
12+
- Fixed an issue where `allow_duplicate_names` field on the pipeline definition was ignored by the bundle ([#3274](https://github.com/databricks/cli/pull/3274))
1213

1314
### API Changes

acceptance/bundle/deploy/pipeline/allow-duplicate-names/output.txt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,16 @@
22
>>> [CLI] bundle deploy
33
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default/files...
44
Deploying resources...
5-
Error: terraform apply: exit status 1
6-
7-
Error: cannot create pipeline: The pipeline name 'test-pipeline-same-name-[UNIQUE_NAME]' is already used by another pipeline. This check can be skipped by setting `allow_duplicate_names = true` in the request.
8-
9-
with databricks_pipeline.pipeline_one,
10-
on bundle.tf.json line 30, in resource.databricks_pipeline.pipeline_one:
11-
30: }
12-
13-
14-
155
Updating deployment state...
6+
Deployment complete!
167

178
>>> [CLI] bundle destroy --auto-approve
9+
The following resources will be deleted:
10+
delete pipeline pipeline_one
11+
1812
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/acc-bundle-deploy-pipeline-duplicate-names-[UNIQUE_NAME]/default
1913

2014
Deleting files...
2115
Destroy complete!
2216

2317
>>> [CLI] pipelines delete [UUID]
24-
25-
Exit code: 1

acceptance/bundle/deploy/pipeline/allow-duplicate-names/pipeline.json.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "test-pipeline-same-name-$UNIQUE_NAME",
3-
"allow_duplicate_names": true,
43
"libraries": [
54
{
65
"file": {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
Badness = "allow_duplicate_names field does not allow to create a pipeline with a duplicate name"
21
Cloud = true
32
Ignore = ["foo.py","pipeline.json"]

bundle/deploy/terraform/tfdyn/convert_pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func convertPipelineResource(ctx context.Context, vin dyn.Value) (dyn.Value, err
2121
return dyn.InvalidValue, err
2222
}
2323

24-
vout, err = dyn.DropKeys(vout, []string{"allow_duplicate_names", "dry_run"})
24+
vout, err = dyn.DropKeys(vout, []string{"dry_run"})
2525
if err != nil {
2626
return dyn.InvalidValue, err
2727
}

bundle/internal/schema/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ func removePipelineFields(typ reflect.Type, s jsonschema.Schema) jsonschema.Sche
115115
// Even though DABs supports this field, TF provider does not. Thus, we
116116
// should not expose it to the user.
117117
delete(s.Properties, "dry_run")
118-
delete(s.Properties, "allow_duplicate_names")
119118

120119
// These fields are only meant to be set by the DABs client (ie the CLI)
121120
// and thus should not be exposed to the user. These are used to annotate

0 commit comments

Comments
 (0)