Only run kubectl apply on YAML files

pull/6512/head
tstromberg 2020-02-05 14:41:05 -08:00
parent 0feb68c350
commit d66bcad56c
1 changed files with 7 additions and 1 deletions

View File

@ -175,6 +175,8 @@ func isAddonAlreadySet(addon *assets.Addon, enable bool, profile string) (bool,
func enableOrDisableAddonInternal(addon *assets.Addon, cmd command.Runner, data interface{}, enable bool, profile string) error { func enableOrDisableAddonInternal(addon *assets.Addon, cmd command.Runner, data interface{}, enable bool, profile string) error {
files := []string{} files := []string{}
deployFiles := []string{}
for _, addon := range addon.Assets { for _, addon := range addon.Assets {
var f assets.CopyableFile var f assets.CopyableFile
var err error var err error
@ -203,8 +205,12 @@ func enableOrDisableAddonInternal(addon *assets.Addon, cmd command.Runner, data
}() }()
} }
files = append(files, fPath) files = append(files, fPath)
if strings.HasSuffix(fPath, ".yaml") {
deployFiles = append(deployFiles, fPath)
} }
command, err := kubectlCommand(profile, files, enable) }
command, err := kubectlCommand(profile, deployFiles, enable)
if err != nil { if err != nil {
return err return err
} }