Skip to content

Commit

Permalink
Merge branch 'omit-secrets' into custom-release
Browse files Browse the repository at this point in the history
  • Loading branch information
theSuess committed Aug 23, 2019
2 parents f89d263 + 9721d48 commit 53faedd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/kubecfg/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"os"
"regexp"
"sort"
"strings"

isatty "github.com/mattn/go-isatty"
"github.com/sergi/go-diff/diffmatchpatch"
Expand All @@ -44,6 +43,8 @@ var ErrDiffFound = fmt.Errorf("Differences found.")
// Matches all the line starts on a diff text, which is where we put diff markers and indent
var DiffLineStart = regexp.MustCompile("(^|\n)(.)")

var DiffKeyValue = regexp.MustCompile(`"([[:alnum:]_-]+)":\s"([[:alnum:]=+]+)",?`)

// DiffCmd represents the diff subcommand
type DiffCmd struct {
Client dynamic.Interface
Expand Down Expand Up @@ -141,8 +142,7 @@ func (c DiffCmd) formatDiff(diffs []diffmatchpatch.Diff, color bool, omitchanges
text := diff.Text

if omitchanges {
parts := strings.Split(text, ":")
text = parts[0] + ": <omitted>\n"
text = DiffKeyValue.ReplaceAllString(text, "$1: <omitted>")
}
switch diff.Type {
case diffmatchpatch.DiffInsert:
Expand Down

0 comments on commit 53faedd

Please sign in to comment.