Skip to content

Commit

Permalink
remove glog dependency from kustomize code (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liujingfang1 authored Nov 12, 2018
1 parent 1648ece commit 83bc67c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
2 changes: 0 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
name = "github.com/ghodss/yaml"
version = "1.0.0"

[[constraint]]
branch = "master"
name = "github.com/golang/glog"

[[constraint]]
name = "github.com/spf13/cobra"
version = "0.0.2"
Expand Down Expand Up @@ -65,7 +61,3 @@
[[constraint]]
branch = "master"
name = "github.com/hashicorp/go-getter"

[[constraint]]
name = "github.com/krishicks/yaml-patch"
version = "0.0.10"
3 changes: 0 additions & 3 deletions kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ package main
import (
"os"

"github.com/golang/glog"
"sigs.k8s.io/kustomize/k8sdeps"
"sigs.k8s.io/kustomize/pkg/commands"
)

func main() {
defer glog.Flush()

if err := commands.NewDefaultCommand(k8sdeps.NewFactory()).Execute(); err != nil {
os.Exit(1)
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/resmap/resmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ package resmap
import (
"bytes"
"fmt"
"log"
"reflect"
"sort"

"github.com/ghodss/yaml"
"github.com/golang/glog"
"sigs.k8s.io/kustomize/pkg/ifc"
"sigs.k8s.io/kustomize/pkg/resid"
"sigs.k8s.io/kustomize/pkg/resource"
Expand Down Expand Up @@ -181,17 +181,17 @@ func MergeWithOverride(maps ...ResMap) (ResMap, error) {
id = matchedId[0]
switch r.Behavior() {
case ifc.BehaviorReplace:
glog.V(4).Infof(
log.Printf(
"Replace %v with %v", result[id].Map(), r.Map())
r.Replace(result[id])
result[id] = r
result[id].SetBehavior(ifc.BehaviorCreate)
case ifc.BehaviorMerge:
glog.V(4).Infof(
log.Printf(
"Merging %v with %v", result[id].Map(), r.Map())
r.Merge(result[id])
result[id] = r
glog.V(4).Infof(
log.Printf(
"Merged object is %v", result[id].Map())
result[id].SetBehavior(ifc.BehaviorCreate)
default:
Expand Down
4 changes: 2 additions & 2 deletions pkg/target/kusttarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"bytes"
"encoding/json"
"fmt"
"log"
"strings"

"github.com/ghodss/yaml"
"github.com/golang/glog"
"github.com/pkg/errors"
"sigs.k8s.io/kustomize/pkg/constants"
"sigs.k8s.io/kustomize/pkg/fs"
Expand Down Expand Up @@ -318,7 +318,7 @@ func (kt *KustTarget) resolveRefVars(m resmap.ResMap) (map[string]string, error)
}
result[v.Name] = s
} else {
glog.Infof("couldn't resolve v: %v", v)
log.Printf("couldn't resolve v: %v", v)
}
}
return result, nil
Expand Down

0 comments on commit 83bc67c

Please sign in to comment.