Skip to content

Commit

Permalink
Removed usage of sergi/go-diff due to a #181
Browse files Browse the repository at this point in the history
  • Loading branch information
alekc committed Oct 25, 2024
1 parent 8b04321 commit 97ed035
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/icza/dyno v0.0.0-20200205103839-49cb13720835
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/sergi/go-diff v1.3.1
github.com/stretchr/testify v1.9.0
github.com/thedevsaddam/gojsonq/v2 v2.5.2
github.com/zclconf/go-cty v1.15.0
Expand Down Expand Up @@ -102,6 +101,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
Expand Down
10 changes: 5 additions & 5 deletions kubernetes/resource_kubectl_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"strings"
"time"

"github.com/sergi/go-diff/diffmatchpatch"
"k8s.io/cli-runtime/pkg/genericiooptions"
k8sdelete "k8s.io/kubectl/pkg/cmd/delete"

Expand Down Expand Up @@ -308,10 +307,11 @@ metadata:
liveStateYaml := d.Get("live_manifest_incluster").(string)
if stateYaml != liveStateYaml {
log.Printf("[TRACE] DETECTED YAML STATE DIFFERENCE %s vs %s", stateYaml, liveStateYaml)
dmp := diffmatchpatch.New()
patches := dmp.PatchMake(stateYaml, liveStateYaml)
patchText := dmp.PatchToText(patches)
log.Printf("[DEBUG] DETECTED YAML INCLUSTER STATE DIFFERENCE. Patch diff: %s", patchText)
// disabled due to a bug in go-diff library. See https://github.com/alekc/terraform-provider-kubectl/issues/181
//dmp := diffmatchpatch.New()
//patches := dmp.PatchMake(stateYaml, liveStateYaml)
//patchText := dmp.PatchToText(patches)
//log.Printf("[DEBUG] DETECTED YAML INCLUSTER STATE DIFFERENCE. Patch diff: %s", patchText)
_ = d.SetNewComputed("yaml_incluster")
}

Expand Down

0 comments on commit 97ed035

Please sign in to comment.