Skip to content

Commit

Permalink
Building kustomize directory
Browse files Browse the repository at this point in the history
  • Loading branch information
luizbafilho committed Nov 30, 2020
1 parent b3e580d commit eda3f22
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ require (
k8s.io/cli-runtime v0.17.2
k8s.io/client-go v0.17.2
sigs.k8s.io/controller-runtime v0.5.0
sigs.k8s.io/kustomize v2.0.3+incompatible
)
17 changes: 17 additions & 0 deletions lokustctl/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import (
"github.com/markbates/pkger"
"github.com/markbates/pkger/pkging"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
"sigs.k8s.io/kustomize/k8sdeps"
"sigs.k8s.io/kustomize/pkg/commands/build"
"sigs.k8s.io/kustomize/pkg/fs"
)

// installCmd represents the install command
Expand All @@ -47,6 +51,19 @@ func installRun(cmd *cobra.Command, args []string) {
if err != nil {
panic(err)
}

stream := genericclioptions.IOStreams{
In: os.Stdin,
Out: os.Stdout,
ErrOut: os.Stderr,
}

f := k8sdeps.NewFactory()
o := build.NewOptions(dir+"/default", "")
err = o.RunBuild(stream.Out, fs.MakeRealFS(), f.ResmapF, f.TransformerF)
if err != nil {
panic(err)
}
}

func copyDir(source, destination string) error {
Expand Down
2 changes: 1 addition & 1 deletion lokustctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func initConfig() {

// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
fmt.Println("Using config file:", viper.ConfigFileUsed())
// fmt.Println("Using config file:", viper.ConfigFileUsed())
}

err := viper.Unmarshal(&config)
Expand Down

0 comments on commit eda3f22

Please # to comment.