direct: Fix spurious recreate of external volumes with trailing-slash storage_location#5145
Merged
Conversation
| return nil | ||
| } | ||
|
|
||
| if newStr != remoteStr && strings.TrimRight(newStr, "/") == strings.TrimRight(remoteStr, "/") { |
Contributor
There was a problem hiding this comment.
Shall we store the storage_location in the state without the slash instead?
Contributor
Author
There was a problem hiding this comment.
I don't think so, state is tracking the config. If user has slash in the config, we do that as well.
Normalized comparison is more explicit.
janniklasrose
approved these changes
Apr 30, 2026
| catalog_name: main | ||
| schema_name: default | ||
| volume_type: EXTERNAL | ||
| storage_location: s3://test-bucket/path/ |
Contributor
There was a problem hiding this comment.
consider multiple / as suffix to ensure TrimRight does the expected thing
…_location The UC API strips trailing slashes from storage_location on create, causing the direct engine to detect drift on every subsequent plan and trigger a full delete+create cycle. Fix: add OverrideChangeDesc to ResourceVolume that treats storage_location values differing only by trailing slashes as equivalent (alias), matching the Terraform provider's suppressLocationDiff behavior. Also update the testserver to accept storage_location on EXTERNAL volumes and strip the trailing slash, mirroring UC API behavior so the bug and fix are reproducible locally. Add an invariant no_drift test for external volumes. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
…ocation Co-authored-by: Isaac
f6d367a to
0ded0ac
Compare
Co-authored-by: Isaac
andrewnester
approved these changes
Apr 30, 2026
Co-authored-by: Isaac
denik
added a commit
that referenced
this pull request
May 20, 2026
… storage_location (#5145) The UC API strips trailing slashes from storage_location on create, causing the direct engine to detect drift on every subsequent plan and trigger a full delete+create cycle. Fix: add OverrideChangeDesc to ResourceVolume that treats storage_location values differing only by trailing slashes as equivalent (alias), matching the Terraform provider's suppressLocationDiff behavior. Also update the testserver to accept storage_location on EXTERNAL volumes and strip the trailing slash, mirroring UC API behavior so the bug and fix are reproducible locally. Add an invariant no_drift test for external volumes. Co-authored-by: Isaac
denik
added a commit
that referenced
this pull request
Jun 10, 2026
…names (#5531) The direct engine saves local config to state, so when Unity Catalog lowercases a schema/volume identifier, the next deploy sees the original mixed-case value drift against the normalized remote value and recreates/renames the resource — on every second deploy with no config changes. This PR fixes that. The fix is expressed declaratively via a new `resources.yml` key, `normalize_case`. The same mechanism also absorbs the existing trailing-slash `storage_location` suppression (#5145) as a second key, `normalize_slash` — a refactor of behavior that already lived in per-resource `OverrideChangeDesc` methods, not a new behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The UC API strips trailing slashes from storage_location on create, causing the direct engine to detect drift on every subsequent plan and trigger a full delete+create cycle.
Fix: add OverrideChangeDesc to ResourceVolume that treats storage_location values differing only by trailing slashes as equivalent (alias), matching the Terraform provider's suppressLocationDiff behavior.
Also update the testserver to accept storage_location on EXTERNAL volumes and strip the trailing slash, mirroring UC API behavior so the bug and fix are reproducible locally. Add an invariant no_drift test for external volumes.
Co-authored-by: Isaac