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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user