1
0
mirror of https://github.com/ko-build/ko.git synced 2025-07-06 23:36:54 +02:00

remove deprecated k8s flags support (#750)

This commit is contained in:
Jason Hall
2022-07-13 16:29:54 -04:00
committed by GitHub
parent 8f228585b9
commit ca1648dcbf
7 changed files with 42 additions and 247 deletions

View File

@ -17,12 +17,10 @@ package commands
import (
"errors"
"fmt"
"log"
"os"
"os/exec"
"strings"
"github.com/google/ko/internal"
"github.com/google/ko/pkg/commands/options"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
@ -30,7 +28,6 @@ import (
// addCreate augments our CLI surface with apply.
func addCreate(topLevel *cobra.Command) {
var kf internal.KubectlFlags
po := &options.PublishOptions{}
fo := &options.FilenameOptions{}
so := &options.SelectorOptions{}
@ -90,16 +87,7 @@ func addCreate(topLevel *cobra.Command) {
// Issue a "kubectl create" command reading from stdin,
// to which we will pipe the resolved files, and any
// remaining flags passed after '--'.
argv := []string{"create", "-f", "-"}
if kflags := kf.Values(); len(kflags) != 0 {
skflags := strings.Join(stripPassword(kflags), " ")
log.Printf(kubectlFlagsWarningTemplate,
"create", skflags,
"create", skflags)
argv = append(argv, kflags...)
}
argv = append(argv, args...)
kubectlCmd := exec.CommandContext(ctx, "kubectl", argv...)
kubectlCmd := exec.CommandContext(ctx, "kubectl", append([]string{"create", "-f", "-"}, args...)...)
// Pass through our environment
kubectlCmd.Env = os.Environ()
@ -145,7 +133,6 @@ func addCreate(topLevel *cobra.Command) {
options.AddFileArg(create, fo)
options.AddSelectorArg(create, so)
options.AddBuildOptions(create, bo)
internal.AddFlags(&kf, create.Flags())
topLevel.AddCommand(create)
}