-
Notifications
You must be signed in to change notification settings - Fork 449
Fix handling of force
option in databricks_git_credential
#4873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
With introduction of support for multiple Git credentials the error message did change a bit, so the `force` option may not work in all cases. Resolves #4871
func isOnlyOneGitCredentialError(err error) bool { | ||
errStr := err.Error() | ||
return errors.Is(err, apierr.ErrResourceConflict) || | ||
(strings.Contains(errStr, "Only one Git credential is supported ") && strings.Contains(errStr, " at this time")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the old error message. Are you intending to parse the new one for SPs + multiple git creds? https://sourcegraph.prod.databricks-corp.com/databricks-eng/universe/-/blob/projects/main/scala/credentials/messages/GitCredentialsMessages.scala?L10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main question here is - can we rely only on HTTP 409, or do we still need to rely on error messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case for single credential for SP is handled now via errors.Is(err, apierr.ErrResourceConflict)
Co-authored-by: Grant Eaton <101603396+GrantIsEaton@users.noreply.github.com>
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
## Release v1.86.0 ### Breaking Changes * Do not set `run_as from run_as_user_name in DLT pipelines. This fixes an issue where the value for run_as was unintentionally cached in the terraform state. More details and the workaround are specified in the PR: ([#4886](#4886)) ### New Features and Improvements * Don't redeploy `databricks_sql_table` for tables with struct subcolumns ([#4001](#4001)). * Added ability to add `comment` when defining a new `databricks_share` ([#4802](#4802)) * Added output attribute `endpoint_url` in `databricks_model_serving` ([#4877](#4877)). * Deprecate `egg` library type in `databricks_cluster`, `databricks_job`, and `databricks_library` ([#4881](#4881)). * Support `databricks_service_principal_secret` on workspace level ([#4896](#4896)). * Added resources and data sources for `databricks_clean_room_asset`, `databricks_clean_room_auto_approval_rule` and `databricks_clean_room_asset_revisions_clean_room_asset` ([#4907](#4907)). ### Bug Fixes * Corrected accidentally removed `SpID` field from `databricks_service_principal` ([#4868](#4868)). * Corrected optional fields in `databricks_mws_ncc_private_endpoint_rule`([#4856](#4856)). * Fix handling of `force` option in `databricks_git_credential` ([#4873](#4873)). * Restricted create or replace statement to managed tables in `databricks_sql_table`([#4874](#4874)). * Mitigate issue due to internal caching in `databricks_secret_acl` by retrying until ACL are applied with the right permission ([#4885](#4885)). * Fix schema mismatch bug in `databricks_functions` data source ([#4902](#4902)). * Set suppressDiff on string_shared_as in the Legacy databricks_share Resource ([#4904](#4904)). ### Documentation * Updated `share` documentation to be more in line with Terraform styling ([#4802](#4802)) * Refreshed `databricks_job` documentation ([#4861](#4861)). * Document `environment` block in `databricks_pipeline` ([#4878](#4878)). * Updated documentation for `databricks_disable_legacy_dbfs_setting` resource ([#4870](#4870)). * Add deprecation notice to `databricks_dbfs_file` and `databricks_mount` ([#4876](#4876)) * Updated documentation for `databricks_disable_legacy_features_setting` resource ([#4884](#4884)). * Improve docs for `databricks_compliance_security_profile_setting` ([#4880](#4880)). * Improve instructions for the Terraform Exporter ([#4892](#4892)). * Improve documentation for service principal data sources ([#4900](#4900)). * Add warning about disabling legacy features and default catalog ([#4905](#4905)). * Improve documentation for grants resources ([#4906](#4906)) ### Exporter * Added support for exporting of workspaces and related resources ([#4899](#4899)). ### Internal Changes * Promote Plugin Framework Share Resource to Production ([#4846](#4846)). * Update Go SDK to v0.79.0 ([#4907](#4907)).
With introduction of support for multiple Git credentials the error message did change a bit, so the
force
option may not work in all cases.Resolves #4871
Changes
Tests
make test
run locallydocs/
folderinternal/acceptance
NEXT_CHANGELOG.md
file