From bd90b08db18a27a99026e7560b90d95b68552379 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 20 May 2026 13:07:35 +0200 Subject: [PATCH] direct: pass last-persisted state to DoDelete Extends IResource.DoDelete to take the resource's last-persisted state alongside id. The framework loads it from dstate in DeploymentUnit.Delete and DeploymentUnit.Recreate, and Adapter.DoDelete forwards it to the resource implementation. No behavioral change in this PR: every existing resource ignores the new argument (_ *FooState). Motivation: some delete APIs need values that come from local config (e.g. postgres_project.purge_on_delete, which is set on the user's resource and forwarded to the Lakebase DeleteProject RPC). Today there is nowhere to plumb those values because DoDelete only sees the resource id. This change keeps the call symmetric with DoCreate/DoUpdate, which already receive state. Co-authored-by: Isaac --- bundle/direct/apply.go | 31 +++++++++++++++++-- bundle/direct/dresources/adapter.go | 18 +++++------ bundle/direct/dresources/alert.go | 2 +- bundle/direct/dresources/all_test.go | 2 +- bundle/direct/dresources/app.go | 2 +- bundle/direct/dresources/catalog.go | 2 +- bundle/direct/dresources/cluster.go | 2 +- bundle/direct/dresources/dashboard.go | 2 +- bundle/direct/dresources/database_catalog.go | 2 +- bundle/direct/dresources/database_instance.go | 2 +- bundle/direct/dresources/experiment.go | 2 +- bundle/direct/dresources/external_location.go | 2 +- bundle/direct/dresources/grants.go | 2 +- bundle/direct/dresources/job.go | 2 +- bundle/direct/dresources/model.go | 2 +- .../dresources/model_serving_endpoint.go | 2 +- bundle/direct/dresources/permissions.go | 2 +- bundle/direct/dresources/pipeline.go | 2 +- bundle/direct/dresources/postgres_branch.go | 2 +- bundle/direct/dresources/postgres_endpoint.go | 2 +- bundle/direct/dresources/postgres_project.go | 2 +- bundle/direct/dresources/quality_monitor.go | 2 +- bundle/direct/dresources/registered_model.go | 2 +- bundle/direct/dresources/schema.go | 2 +- bundle/direct/dresources/secret_scope.go | 2 +- bundle/direct/dresources/secret_scope_acls.go | 2 +- bundle/direct/dresources/sql_warehouse.go | 2 +- .../dresources/synced_database_table.go | 2 +- .../dresources/vector_search_endpoint.go | 2 +- bundle/direct/dresources/volume.go | 2 +- 30 files changed, 66 insertions(+), 39 deletions(-) diff --git a/bundle/direct/apply.go b/bundle/direct/apply.go index e327cb8563e..8932455a5a9 100644 --- a/bundle/direct/apply.go +++ b/bundle/direct/apply.go @@ -80,11 +80,16 @@ func (d *DeploymentUnit) Create(ctx context.Context, db *dstate.DeploymentState, } func (d *DeploymentUnit) Recreate(ctx context.Context, db *dstate.DeploymentState, oldID string, newState any) error { + oldState, err := d.loadPersistedState(db) + if err != nil { + return err + } + // Note, unlike Delete(), we hard error on 403 here intentionally. // MANAGED_BY_PARENT is still disregarded — the subsequent Create with // replace_existing=true will reconfigure the parent-managed resource in // place, matching the Terraform provider's recreate behaviour. - err := d.Adapter.DoDelete(ctx, oldID) + err = d.Adapter.DoDelete(ctx, oldID, oldState) if err != nil && !isResourceGone(err) && !isManagedByParent(err) { return fmt.Errorf("deleting old id=%s: %w", oldID, err) } @@ -170,7 +175,12 @@ func (d *DeploymentUnit) UpdateWithID(ctx context.Context, db *dstate.Deployment } func (d *DeploymentUnit) Delete(ctx context.Context, db *dstate.DeploymentState, oldID string) error { - err := d.Adapter.DoDelete(ctx, oldID) + oldState, err := d.loadPersistedState(db) + if err != nil { + return err + } + + err = d.Adapter.DoDelete(ctx, oldID, oldState) if err != nil && !isResourceGone(err) && !isManagedByParent(err) { // Rather than failing delete and requiring user to unbind, we perform unbind automatically there. // Some services, e.g. jobs, return 403 for missing resources if caller did not have permissions to it when job existed. @@ -215,6 +225,23 @@ func parseState(destType reflect.Type, raw json.RawMessage) (any, error) { return reflect.ValueOf(destPtr).Elem().Interface(), nil } +// loadPersistedState reads and parses the resource's last-persisted state for +// the DoDelete call. Returns a zero-value state pointer when nothing has been +// persisted yet (e.g. delete after a partial-create failure), so the call site +// always passes a typed value. +func (d *DeploymentUnit) loadPersistedState(db *dstate.DeploymentState) (any, error) { + stateType := d.Adapter.StateType() + dbentry, ok := db.GetResourceEntry(d.ResourceKey) + if !ok || len(dbentry.State) == 0 { + return reflect.New(stateType.Elem()).Interface(), nil + } + state, err := parseState(stateType, dbentry.State) + if err != nil { + return nil, fmt.Errorf("parsing persisted state: %w", err) + } + return state, nil +} + func (d *DeploymentUnit) refreshRemoteState(ctx context.Context, id string) error { if d.RemoteState != nil { return nil diff --git a/bundle/direct/dresources/adapter.go b/bundle/direct/dresources/adapter.go index 5e46dad540b..34c9a485f6b 100644 --- a/bundle/direct/dresources/adapter.go +++ b/bundle/direct/dresources/adapter.go @@ -42,9 +42,11 @@ type IResource interface { // Example: func (r *ResourceJob) DoRead(ctx context.Context, id string) (*jobs.Job, error) DoRead(ctx context.Context, id string) (remoteState any, e error) - // DoDelete deletes the resource. - // Example: func (r *ResourceJob) DoDelete(ctx context.Context, id string) error - DoDelete(ctx context.Context, id string) error + // DoDelete deletes the resource. The state argument is the last-persisted + // state for the resource; resources that don't need it should accept it as + // _ to satisfy the interface. + // Example: func (r *ResourceJob) DoDelete(ctx context.Context, id string, _ *jobs.JobSettings) error + DoDelete(ctx context.Context, id string, state any) error // [Optional] OverrideChangeDesc can implement custom logic to update a given ChangeDesc; it is run last after built-in classifiers and field triggers. OverrideChangeDesc(ctx context.Context, path *structpath.PathNode, changedesc *ChangeDesc, remoteState any) error @@ -264,6 +266,7 @@ func (a *Adapter) validate() error { validations := []any{ "PrepareState return", a.prepareState.OutTypes[0], stateType, "DoCreate newState", a.doCreate.InTypes[1], stateType, + "DoDelete state", a.doDelete.InTypes[2], stateType, } // If RemapState is implemented, validate its signature. @@ -399,12 +402,9 @@ func (a *Adapter) DoRead(ctx context.Context, id string) (any, error) { return outs[0], nil } -func (a *Adapter) DoDelete(ctx context.Context, id string) error { - _, err := a.doDelete.Call(ctx, id) - if err != nil { - return err - } - return nil +func (a *Adapter) DoDelete(ctx context.Context, id string, state any) error { + _, err := a.doDelete.Call(ctx, id, state) + return err } // normalizeNilPointer converts a nil pointer wrapped in an interface to a nil interface. diff --git a/bundle/direct/dresources/alert.go b/bundle/direct/dresources/alert.go index 4fa4e410a1e..a18641e810a 100644 --- a/bundle/direct/dresources/alert.go +++ b/bundle/direct/dresources/alert.go @@ -59,7 +59,7 @@ func (r *ResourceAlert) DoUpdate(ctx context.Context, id string, config *sql.Ale } // DoDelete deletes the alert by id. -func (r *ResourceAlert) DoDelete(ctx context.Context, id string) error { +func (r *ResourceAlert) DoDelete(ctx context.Context, id string, _ *sql.AlertV2) error { return r.client.AlertsV2.TrashAlert(ctx, sql.TrashAlertV2Request{ Id: id, Purge: true, diff --git a/bundle/direct/dresources/all_test.go b/bundle/direct/dresources/all_test.go index 2c0a2e52f22..f1d61a80c78 100644 --- a/bundle/direct/dresources/all_test.go +++ b/bundle/direct/dresources/all_test.go @@ -849,7 +849,7 @@ func testCRUD(t *testing.T, group string, adapter *Adapter, client *databricks.W assert.Equal(t, val, remoteValue, "path=%q\nnewState=%s\nremappedState=%s", path.String(), jsonDump(newState), jsonDump(remappedState)) })) - err = adapter.DoDelete(ctx, createdID) + err = adapter.DoDelete(ctx, createdID, newState) require.NoError(t, err) p, err := structpath.ParsePath("name") diff --git a/bundle/direct/dresources/app.go b/bundle/direct/dresources/app.go index 8cae2e50e67..2d2e0620482 100644 --- a/bundle/direct/dresources/app.go +++ b/bundle/direct/dresources/app.go @@ -316,7 +316,7 @@ func deploymentToAppConfig(d *apps.AppDeployment) *resources.AppConfig { return config } -func (r *ResourceApp) DoDelete(ctx context.Context, id string) error { +func (r *ResourceApp) DoDelete(ctx context.Context, id string, _ *AppState) error { _, err := r.client.Apps.DeleteByName(ctx, id) return err } diff --git a/bundle/direct/dresources/catalog.go b/bundle/direct/dresources/catalog.go index 2e090ddfb8e..1ce28b54123 100644 --- a/bundle/direct/dresources/catalog.go +++ b/bundle/direct/dresources/catalog.go @@ -104,7 +104,7 @@ func (r *ResourceCatalog) DoUpdateWithID(ctx context.Context, id string, config return newID, response, nil } -func (r *ResourceCatalog) DoDelete(ctx context.Context, id string) error { +func (r *ResourceCatalog) DoDelete(ctx context.Context, id string, _ *catalog.CreateCatalog) error { return r.client.Catalogs.Delete(ctx, catalog.DeleteCatalogRequest{ Name: id, Force: true, diff --git a/bundle/direct/dresources/cluster.go b/bundle/direct/dresources/cluster.go index 46148a2655f..c7557db035c 100644 --- a/bundle/direct/dresources/cluster.go +++ b/bundle/direct/dresources/cluster.go @@ -117,7 +117,7 @@ func (r *ResourceCluster) DoResize(ctx context.Context, id string, config *compu return err } -func (r *ResourceCluster) DoDelete(ctx context.Context, id string) error { +func (r *ResourceCluster) DoDelete(ctx context.Context, id string, _ *compute.ClusterSpec) error { return r.client.Clusters.PermanentDeleteByClusterId(ctx, id) } diff --git a/bundle/direct/dresources/dashboard.go b/bundle/direct/dresources/dashboard.go index 6c4a9f1f611..dbf492a0bee 100644 --- a/bundle/direct/dresources/dashboard.go +++ b/bundle/direct/dresources/dashboard.go @@ -357,7 +357,7 @@ func (r *ResourceDashboard) DoUpdate(ctx context.Context, id string, config *Das return responseToState(updateResp, publishResp, dashboard.SerializedDashboard, config.Published), nil } -func (r *ResourceDashboard) DoDelete(ctx context.Context, id string) error { +func (r *ResourceDashboard) DoDelete(ctx context.Context, id string, _ *DashboardState) error { return r.client.Lakeview.Trash(ctx, dashboards.TrashDashboardRequest{ DashboardId: id, }) diff --git a/bundle/direct/dresources/database_catalog.go b/bundle/direct/dresources/database_catalog.go index ea97574d4b5..9bffa708d73 100644 --- a/bundle/direct/dresources/database_catalog.go +++ b/bundle/direct/dresources/database_catalog.go @@ -45,7 +45,7 @@ func (r *ResourceDatabaseCatalog) DoUpdate(ctx context.Context, id string, confi return nil, err } -func (r *ResourceDatabaseCatalog) DoDelete(ctx context.Context, id string) error { +func (r *ResourceDatabaseCatalog) DoDelete(ctx context.Context, id string, _ *database.DatabaseCatalog) error { return r.client.Database.DeleteDatabaseCatalog(ctx, database.DeleteDatabaseCatalogRequest{ Name: id, }) diff --git a/bundle/direct/dresources/database_instance.go b/bundle/direct/dresources/database_instance.go index d3bceda4b7d..2169a61fc8e 100644 --- a/bundle/direct/dresources/database_instance.go +++ b/bundle/direct/dresources/database_instance.go @@ -60,7 +60,7 @@ func (d *ResourceDatabaseInstance) WaitAfterCreate(ctx context.Context, id strin return nil, err } -func (d *ResourceDatabaseInstance) DoDelete(ctx context.Context, name string) error { +func (d *ResourceDatabaseInstance) DoDelete(ctx context.Context, name string, _ *database.DatabaseInstance) error { return d.client.Database.DeleteDatabaseInstance(ctx, database.DeleteDatabaseInstanceRequest{ Name: name, Purge: true, diff --git a/bundle/direct/dresources/experiment.go b/bundle/direct/dresources/experiment.go index de62720fe80..bedabc81365 100644 --- a/bundle/direct/dresources/experiment.go +++ b/bundle/direct/dresources/experiment.go @@ -68,7 +68,7 @@ func (r *ResourceExperiment) DoUpdate(ctx context.Context, id string, config *ml return nil, r.client.Experiments.UpdateExperiment(ctx, updateReq) } -func (r *ResourceExperiment) DoDelete(ctx context.Context, id string) error { +func (r *ResourceExperiment) DoDelete(ctx context.Context, id string, _ *ml.CreateExperiment) error { return r.client.Experiments.DeleteExperiment(ctx, ml.DeleteExperiment{ ExperimentId: id, }) diff --git a/bundle/direct/dresources/external_location.go b/bundle/direct/dresources/external_location.go index a9715b06190..64eace48eb3 100644 --- a/bundle/direct/dresources/external_location.go +++ b/bundle/direct/dresources/external_location.go @@ -117,7 +117,7 @@ func (r *ResourceExternalLocation) DoUpdateWithID(ctx context.Context, id string return newID, response, nil } -func (r *ResourceExternalLocation) DoDelete(ctx context.Context, id string) error { +func (r *ResourceExternalLocation) DoDelete(ctx context.Context, id string, _ *catalog.CreateExternalLocation) error { return r.client.ExternalLocations.Delete(ctx, catalog.DeleteExternalLocationRequest{ Name: id, Force: true, diff --git a/bundle/direct/dresources/grants.go b/bundle/direct/dresources/grants.go index 8bb19061224..c5b15e920b3 100644 --- a/bundle/direct/dresources/grants.go +++ b/bundle/direct/dresources/grants.go @@ -128,7 +128,7 @@ func (r *ResourceGrants) DoUpdate(ctx context.Context, _ string, state *GrantsSt return nil, err } -func (r *ResourceGrants) DoDelete(ctx context.Context, id string) error { +func (r *ResourceGrants) DoDelete(ctx context.Context, id string, _ *GrantsState) error { // Similar to permissions, we do nothing there. // We could delete all grants there, but it would be confusing to explain wrt permissions. return nil diff --git a/bundle/direct/dresources/job.go b/bundle/direct/dresources/job.go index 9477bf52517..40ea745f09b 100644 --- a/bundle/direct/dresources/job.go +++ b/bundle/direct/dresources/job.go @@ -141,7 +141,7 @@ func (r *ResourceJob) DoUpdate(ctx context.Context, id string, config *jobs.JobS return nil, r.client.Jobs.Reset(ctx, request) } -func (r *ResourceJob) DoDelete(ctx context.Context, id string) error { +func (r *ResourceJob) DoDelete(ctx context.Context, id string, _ *jobs.JobSettings) error { idInt, err := parseJobID(id) if err != nil { return err diff --git a/bundle/direct/dresources/model.go b/bundle/direct/dresources/model.go index 52a3b1075de..9d04231456d 100644 --- a/bundle/direct/dresources/model.go +++ b/bundle/direct/dresources/model.go @@ -97,7 +97,7 @@ func (r *ResourceMlflowModel) DoUpdate(ctx context.Context, id string, config *m }, nil } -func (r *ResourceMlflowModel) DoDelete(ctx context.Context, id string) error { +func (r *ResourceMlflowModel) DoDelete(ctx context.Context, id string, _ *ml.CreateModelRequest) error { return r.client.ModelRegistry.DeleteModel(ctx, ml.DeleteModelRequest{ Name: id, }) diff --git a/bundle/direct/dresources/model_serving_endpoint.go b/bundle/direct/dresources/model_serving_endpoint.go index 35aec6ffd44..ccab3a13dea 100644 --- a/bundle/direct/dresources/model_serving_endpoint.go +++ b/bundle/direct/dresources/model_serving_endpoint.go @@ -327,6 +327,6 @@ func (r *ResourceModelServingEndpoint) DoUpdate(ctx context.Context, id string, return nil, nil } -func (r *ResourceModelServingEndpoint) DoDelete(ctx context.Context, id string) error { +func (r *ResourceModelServingEndpoint) DoDelete(ctx context.Context, id string, _ *serving.CreateServingEndpoint) error { return r.client.ServingEndpoints.DeleteByName(ctx, id) } diff --git a/bundle/direct/dresources/permissions.go b/bundle/direct/dresources/permissions.go index eac5e2dcdbc..6755dac69ca 100644 --- a/bundle/direct/dresources/permissions.go +++ b/bundle/direct/dresources/permissions.go @@ -259,7 +259,7 @@ func (r *ResourcePermissions) DoUpdate(ctx context.Context, _ string, newState * // it themselves. Trying to fix permissions back requires // - making assumptions on what it should look like // - storing current user somewhere or storing original permissions somewhere -func (r *ResourcePermissions) DoDelete(ctx context.Context, id string) error { +func (r *ResourcePermissions) DoDelete(ctx context.Context, id string, _ *PermissionsState) error { // intentional noop return nil } diff --git a/bundle/direct/dresources/pipeline.go b/bundle/direct/dresources/pipeline.go index 9a59ab4e40b..3ce1e26ac55 100644 --- a/bundle/direct/dresources/pipeline.go +++ b/bundle/direct/dresources/pipeline.go @@ -170,7 +170,7 @@ func (r *ResourcePipeline) DoUpdate(ctx context.Context, id string, config *pipe return nil, r.client.Pipelines.Update(ctx, request) } -func (r *ResourcePipeline) DoDelete(ctx context.Context, id string) error { +func (r *ResourcePipeline) DoDelete(ctx context.Context, id string, _ *pipelines.CreatePipeline) error { return r.client.Pipelines.DeleteByPipelineId(ctx, id) } diff --git a/bundle/direct/dresources/postgres_branch.go b/bundle/direct/dresources/postgres_branch.go index f2b2a982ed5..632b15ad84f 100644 --- a/bundle/direct/dresources/postgres_branch.go +++ b/bundle/direct/dresources/postgres_branch.go @@ -171,7 +171,7 @@ func (r *ResourcePostgresBranch) DoUpdate(ctx context.Context, id string, config return makePostgresBranchRemote(result), nil } -func (r *ResourcePostgresBranch) DoDelete(ctx context.Context, id string) error { +func (r *ResourcePostgresBranch) DoDelete(ctx context.Context, id string, _ *PostgresBranchState) error { waiter, err := r.client.Postgres.DeleteBranch(ctx, postgres.DeleteBranchRequest{ Name: id, }) diff --git a/bundle/direct/dresources/postgres_endpoint.go b/bundle/direct/dresources/postgres_endpoint.go index 81821afeb43..f99054f4c82 100644 --- a/bundle/direct/dresources/postgres_endpoint.go +++ b/bundle/direct/dresources/postgres_endpoint.go @@ -217,7 +217,7 @@ func (r *ResourcePostgresEndpoint) DoUpdate(ctx context.Context, id string, conf return r.waitForReconciliation(ctx, id) } -func (r *ResourcePostgresEndpoint) DoDelete(ctx context.Context, id string) error { +func (r *ResourcePostgresEndpoint) DoDelete(ctx context.Context, id string, _ *PostgresEndpointState) error { // Retry loop to handle "Endpoint reconciliation still in progress" errors deadline := time.Now().Add(endpointReconciliationTimeout) for { diff --git a/bundle/direct/dresources/postgres_project.go b/bundle/direct/dresources/postgres_project.go index d19834876c8..24b6689304b 100644 --- a/bundle/direct/dresources/postgres_project.go +++ b/bundle/direct/dresources/postgres_project.go @@ -168,7 +168,7 @@ func (r *ResourcePostgresProject) DoUpdate(ctx context.Context, id string, confi return makePostgresProjectRemote(result), nil } -func (r *ResourcePostgresProject) DoDelete(ctx context.Context, id string) error { +func (r *ResourcePostgresProject) DoDelete(ctx context.Context, id string, _ *PostgresProjectState) error { waiter, err := r.client.Postgres.DeleteProject(ctx, postgres.DeleteProjectRequest{ Name: id, Purge: false, diff --git a/bundle/direct/dresources/quality_monitor.go b/bundle/direct/dresources/quality_monitor.go index 38667796183..c66fed4e0bb 100644 --- a/bundle/direct/dresources/quality_monitor.go +++ b/bundle/direct/dresources/quality_monitor.go @@ -110,7 +110,7 @@ func (r *ResourceQualityMonitor) DoUpdate(ctx context.Context, id string, config return response, nil } -func (r *ResourceQualityMonitor) DoDelete(ctx context.Context, id string) error { +func (r *ResourceQualityMonitor) DoDelete(ctx context.Context, id string, _ *QualityMonitorState) error { //nolint:staticcheck // Direct quality_monitor resource still uses legacy monitor endpoints; v1 data-quality migration is separate work. _, err := r.client.QualityMonitors.Delete(ctx, catalog.DeleteQualityMonitorRequest{ TableName: id, diff --git a/bundle/direct/dresources/registered_model.go b/bundle/direct/dresources/registered_model.go index e191f52b8bb..888870a7581 100644 --- a/bundle/direct/dresources/registered_model.go +++ b/bundle/direct/dresources/registered_model.go @@ -98,7 +98,7 @@ func (r *ResourceRegisteredModel) DoUpdate(ctx context.Context, id string, confi return response, nil } -func (r *ResourceRegisteredModel) DoDelete(ctx context.Context, id string) error { +func (r *ResourceRegisteredModel) DoDelete(ctx context.Context, id string, _ *catalog.CreateRegisteredModelRequest) error { return r.client.RegisteredModels.Delete(ctx, catalog.DeleteRegisteredModelRequest{ FullName: id, }) diff --git a/bundle/direct/dresources/schema.go b/bundle/direct/dresources/schema.go index 783b87caf96..f082ea6c547 100644 --- a/bundle/direct/dresources/schema.go +++ b/bundle/direct/dresources/schema.go @@ -69,7 +69,7 @@ func (r *ResourceSchema) DoUpdate(ctx context.Context, id string, config *catalo return response, nil } -func (r *ResourceSchema) DoDelete(ctx context.Context, id string) error { +func (r *ResourceSchema) DoDelete(ctx context.Context, id string, _ *catalog.CreateSchema) error { return r.client.Schemas.Delete(ctx, catalog.DeleteSchemaRequest{ FullName: id, Force: true, diff --git a/bundle/direct/dresources/secret_scope.go b/bundle/direct/dresources/secret_scope.go index 420424997a6..c811dc84d77 100644 --- a/bundle/direct/dresources/secret_scope.go +++ b/bundle/direct/dresources/secret_scope.go @@ -78,6 +78,6 @@ func (r *ResourceSecretScope) DoCreate(ctx context.Context, state *SecretScopeCo // DoUpdate is not intentionally implemented here because scopes do not support a update API. All fields are marked to // return a recreate trigger. -func (r *ResourceSecretScope) DoDelete(ctx context.Context, id string) error { +func (r *ResourceSecretScope) DoDelete(ctx context.Context, id string, _ *SecretScopeConfig) error { return r.client.Secrets.DeleteScopeByScope(ctx, id) } diff --git a/bundle/direct/dresources/secret_scope_acls.go b/bundle/direct/dresources/secret_scope_acls.go index dc03544e9cc..ef04cb7cb6a 100644 --- a/bundle/direct/dresources/secret_scope_acls.go +++ b/bundle/direct/dresources/secret_scope_acls.go @@ -115,7 +115,7 @@ func (r *ResourceSecretScopeAcls) DoUpdate(ctx context.Context, id string, state } // Removing ACLs is a no-op, to match the behavior for permissions and grants. -func (r *ResourceSecretScopeAcls) DoDelete(ctx context.Context, id string) error { +func (r *ResourceSecretScopeAcls) DoDelete(ctx context.Context, id string, _ *SecretScopeAclsState) error { return nil } diff --git a/bundle/direct/dresources/sql_warehouse.go b/bundle/direct/dresources/sql_warehouse.go index 2e8caa4a4a2..704f9f66187 100644 --- a/bundle/direct/dresources/sql_warehouse.go +++ b/bundle/direct/dresources/sql_warehouse.go @@ -89,6 +89,6 @@ func (r *ResourceSqlWarehouse) DoUpdate(ctx context.Context, id string, config * return nil, nil } -func (r *ResourceSqlWarehouse) DoDelete(ctx context.Context, oldID string) error { +func (r *ResourceSqlWarehouse) DoDelete(ctx context.Context, oldID string, _ *sql.CreateWarehouseRequest) error { return r.client.Warehouses.DeleteById(ctx, oldID) } diff --git a/bundle/direct/dresources/synced_database_table.go b/bundle/direct/dresources/synced_database_table.go index 94182b729f3..d45c6fb3fc7 100644 --- a/bundle/direct/dresources/synced_database_table.go +++ b/bundle/direct/dresources/synced_database_table.go @@ -45,7 +45,7 @@ func (r *ResourceSyncedDatabaseTable) DoUpdate(ctx context.Context, id string, c return nil, err } -func (r *ResourceSyncedDatabaseTable) DoDelete(ctx context.Context, id string) error { +func (r *ResourceSyncedDatabaseTable) DoDelete(ctx context.Context, id string, _ *database.SyncedDatabaseTable) error { return r.client.Database.DeleteSyncedDatabaseTable(ctx, database.DeleteSyncedDatabaseTableRequest{ Name: id, PurgeData: false, diff --git a/bundle/direct/dresources/vector_search_endpoint.go b/bundle/direct/dresources/vector_search_endpoint.go index 39211ca63ab..b3b44bb2c8c 100644 --- a/bundle/direct/dresources/vector_search_endpoint.go +++ b/bundle/direct/dresources/vector_search_endpoint.go @@ -110,6 +110,6 @@ func (r *ResourceVectorSearchEndpoint) DoUpdate(ctx context.Context, id string, return nil, nil } -func (r *ResourceVectorSearchEndpoint) DoDelete(ctx context.Context, id string) error { +func (r *ResourceVectorSearchEndpoint) DoDelete(ctx context.Context, id string, _ *vectorsearch.CreateEndpoint) error { return r.client.VectorSearchEndpoints.DeleteEndpointByEndpointName(ctx, id) } diff --git a/bundle/direct/dresources/volume.go b/bundle/direct/dresources/volume.go index 35196bdb388..73bf7a79b40 100644 --- a/bundle/direct/dresources/volume.go +++ b/bundle/direct/dresources/volume.go @@ -110,7 +110,7 @@ func (r *ResourceVolume) DoUpdateWithID(ctx context.Context, id string, config * return response.FullName, response, nil } -func (r *ResourceVolume) DoDelete(ctx context.Context, id string) error { +func (r *ResourceVolume) DoDelete(ctx context.Context, id string, _ *catalog.CreateVolumeRequestContent) error { return r.client.Volumes.DeleteByName(ctx, id) }