mirror of https://github.com/databricks/cli.git
Compare commits
No commits in common. "d9ed8ebeaea6cb0e29c27ee9eb2b4070f7156daf" and "d6c564d531923fb9a13adbdc0187d57d74efdd7e" have entirely different histories.
d9ed8ebeae
...
d6c564d531
|
@ -81,7 +81,7 @@ func approvalForDeploy(ctx context.Context, b *bundle.Bundle) (bool, error) {
|
||||||
|
|
||||||
// Recreating DLT pipeline leads to metadata loss and for a transient period
|
// Recreating DLT pipeline leads to metadata loss and for a transient period
|
||||||
// the underling tables will be unavailable.
|
// the underling tables will be unavailable.
|
||||||
return actions.Replace() || actions.Delete()
|
return actions.Replace()
|
||||||
})
|
})
|
||||||
|
|
||||||
// We don't need to display any prompts in this case.
|
// We don't need to display any prompts in this case.
|
||||||
|
@ -99,12 +99,7 @@ func approvalForDeploy(ctx context.Context, b *bundle.Bundle) (bool, error) {
|
||||||
|
|
||||||
// One or more DLT pipelines is being recreated.
|
// One or more DLT pipelines is being recreated.
|
||||||
if len(dltActions) != 0 {
|
if len(dltActions) != 0 {
|
||||||
msg := `
|
cmdio.LogString(ctx, "The following DLT pipelines will be recreated. This commonly happens when the `catalog` or the `storage` specified for aq DLT pipeline is changed. Underlying tables will be unavailable for a transient period until the newly recreated pipelines are run once successfully. History of previous pipeline update runs will be lost because of recreation:")
|
||||||
This action will result in the deletion or recreation of the following DLT Pipelines along with the
|
|
||||||
Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the Pipelines will
|
|
||||||
restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline
|
|
||||||
properties such as the 'catalog' or 'storage' are changed:`
|
|
||||||
cmdio.LogString(ctx, msg)
|
|
||||||
for _, action := range dltActions {
|
for _, action := range dltActions {
|
||||||
cmdio.Log(ctx, action)
|
cmdio.Log(ctx, action)
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,14 +157,7 @@ func TestAccBundlePipelineRecreateWithoutAutoApprove(t *testing.T) {
|
||||||
stdout, stderr, err := c.Run()
|
stdout, stderr, err := c.Run()
|
||||||
|
|
||||||
assert.EqualError(t, err, root.ErrAlreadyPrinted.Error())
|
assert.EqualError(t, err, root.ErrAlreadyPrinted.Error())
|
||||||
|
assert.Contains(t, stderr.String(), "The following DLT pipelines will be recreated. This commonly happens when the `catalog` or the `storage` specified for a DLT pipeline is changed. Underlying tables will be unavailable for a transient period until the newly recreated pipelines are run once successfully. History of previous pipeline update runs will be lost because of recreation:\n recreate pipeline foo")
|
||||||
fmt.Println("expected: ", "This action will result in the deletion or recreation of the following DLT Pipelines along with the Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the Pipelines will restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline properties such as the `catalog` or `storage` are changed::\n recreate pipeline foo")
|
|
||||||
fmt.Println("stderr: ", stderr.String())
|
|
||||||
assert.Contains(t, stderr.String(), `This action will result in the deletion or recreation of the following DLT Pipelines along with the
|
|
||||||
Streaming Tables (STs) and Materialized Views (MVs) managed by them. Recreating the Pipelines will
|
|
||||||
restore the defined STs and MVs through full refresh. Note that recreation is necessary when pipeline
|
|
||||||
properties such as the 'catalog' or 'storage' are changed:
|
|
||||||
recreate pipeline foo`)
|
|
||||||
assert.Contains(t, stdout.String(), "the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed")
|
assert.Contains(t, stdout.String(), "the deployment requires destructive actions, but current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue