hide core/v1 behind interface

This commit is contained in:
Jingfang Liu
2018-10-09 14:51:37 -07:00
parent 0faef46773
commit f783486057
17 changed files with 112 additions and 77 deletions

View File

@@ -23,7 +23,7 @@ import (
)
// NewCmdAdd returns an instance of 'add' subcommand.
func NewCmdAdd(fsys fs.FileSystem, v ifc.Validator) *cobra.Command {
func NewCmdAdd(fsys fs.FileSystem, v ifc.Validator, kf ifc.KunstructuredFactory) *cobra.Command {
c := &cobra.Command{
Use: "add",
Short: "Adds configmap/resource/patch/base to the kustomization file.",
@@ -53,7 +53,7 @@ func NewCmdAdd(fsys fs.FileSystem, v ifc.Validator) *cobra.Command {
c.AddCommand(
newCmdAddResource(fsys),
newCmdAddPatch(fsys),
newCmdAddConfigMap(fsys),
newCmdAddConfigMap(fsys, kf),
newCmdAddBase(fsys),
newCmdAddLabel(fsys, v.MakeLabelValidator()),
newCmdAddAnnotation(fsys, v.MakeAnnotationValidator()),