Skip to content

Commit

Permalink
Merge pull request #76 from UKHomeOffice/file_order_logging
Browse files Browse the repository at this point in the history
Added debugging (for resolving #45)
  • Loading branch information
lewismarshall authored Apr 19, 2018
2 parents f417246 + a380dc6 commit 47ee9a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func run(c *cli.Context) error {
// Check if all files exist first - fail early on building up a list of files
var files []string
for _, fn := range c.StringSlice("file") {
logDebug.Printf("about to open file:%s\n", fn)
stat, err := os.Stat(fn)
if err != nil {
return err
Expand All @@ -167,6 +168,7 @@ func run(c *cli.Context) error {
// Iterate the list of files and add rendered templates to resources list - fail early.
resources := []*ObjectResource{}
for _, fn := range files {
logDebug.Printf("parsing file:%s\n", fn)
data, err := ioutil.ReadFile(fn)
if err != nil {
return err
Expand Down Expand Up @@ -251,6 +253,7 @@ func splitYamlDocs(data string) []string {
}

func deploy(c *cli.Context, r *ObjectResource) error {
logDebug.Printf("about to deploy resource %s/%s (from file:%q)", r.Kind, r.Name, r.FileName)
args := []string{"apply", "-f", "-"}
cmd, err := newKubeCmd(c, args)
if err != nil {
Expand Down

0 comments on commit 47ee9a9

Please sign in to comment.