Skip to content

Commit

Permalink
fix: remove the logic that sets datalocality to disable when v2 volum…
Browse files Browse the repository at this point in the history
…e is created

Signed-off-by: jinhong.kim0 <jinhong.kim0@navercorp.com>
  • Loading branch information
hookak authored and derekbit committed Sep 23, 2024
1 parent 3c3e123 commit 2edf8ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions webhook/resources/volume/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ func (v *volumeMutator) Create(request *admission.Request, newObj runtime.Object

// TODO: Remove the mutations below after they are implemented for SPDK volumes
if types.IsDataEngineV2(volume.Spec.DataEngine) {
if volume.Spec.DataLocality != longhorn.DataLocalityDisabled {
patchOps = append(patchOps, fmt.Sprintf(`{"op": "replace", "path": "/spec/dataLocality", "value": "%s"}`, longhorn.DataLocalityDisabled))
}
if volume.Spec.SnapshotDataIntegrity != longhorn.SnapshotDataIntegrityDisabled {
patchOps = append(patchOps, fmt.Sprintf(`{"op": "replace", "path": "/spec/snapshotDataIntegrity", "value": "%s"}`, longhorn.SnapshotDataIntegrityDisabled))
}
Expand Down
6 changes: 0 additions & 6 deletions webhook/resources/volume/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,6 @@ func (v *volumeValidator) Update(request *admission.Request, oldObj runtime.Obje
return werror.NewInvalidError(err.Error(), "")
}

if oldVolume.Spec.DataLocality != newVolume.Spec.DataLocality {
err := fmt.Errorf("changing data locality for volume %v is not supported for data engine %v",
newVolume.Name, newVolume.Spec.DataEngine)
return werror.NewInvalidError(err.Error(), "")
}

if oldVolume.Spec.SnapshotDataIntegrity != newVolume.Spec.SnapshotDataIntegrity {
err := fmt.Errorf("changing snapshot data integrity for volume %v is not supported for data engine %v",
newVolume.Name, newVolume.Spec.DataEngine)
Expand Down

0 comments on commit 2edf8ec

Please sign in to comment.