Skip to content

Commit

Permalink
Replace resource.FilenameOptions with []string
Browse files Browse the repository at this point in the history
It was hiding what was actually going on here, which just a slice.
  • Loading branch information
justinsb committed Aug 31, 2019
1 parent 36b3e7b commit 97c83b6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion cmd/kops/BUILD.bazel
Expand Up @@ -116,7 +116,6 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
"//vendor/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library",
"//vendor/k8s.io/cli-runtime/pkg/resource:go_default_library",
"//vendor/k8s.io/client-go/kubernetes:go_default_library",
"//vendor/k8s.io/client-go/plugin/pkg/client/auth:go_default_library",
"//vendor/k8s.io/client-go/tools/clientcmd:go_default_library",
Expand Down
5 changes: 1 addition & 4 deletions cmd/kops/create.go
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/cli-runtime/pkg/resource"
"k8s.io/klog"
"k8s.io/kops/cmd/kops/util"
kopsapi "k8s.io/kops/pkg/apis/kops"
Expand All @@ -39,7 +38,7 @@ import (
)

type CreateOptions struct {
resource.FilenameOptions
Filenames []string
}

var (
Expand Down Expand Up @@ -97,8 +96,6 @@ func NewCmdCreate(f *util.Factory, out io.Writer) *cobra.Command {
}

cmd.Flags().StringSliceVarP(&options.Filenames, "filename", "f", options.Filenames, "Filename to use to create the resource")
//usage := "to use to create the resource"
//cmdutil.AddFilenameOptionFlags(cmd, options, usage)
cmd.MarkFlagRequired("filename")
//cmdutil.AddValidateFlags(cmd)
//cmdutil.AddOutputFlagsForMutation(cmd)
Expand Down
5 changes: 2 additions & 3 deletions cmd/kops/delete.go
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/cli-runtime/pkg/resource"
"k8s.io/klog"
"k8s.io/kops/cmd/kops/util"
kopsapi "k8s.io/kops/pkg/apis/kops"
Expand All @@ -38,8 +37,8 @@ import (
)

type DeleteOptions struct {
resource.FilenameOptions
Yes bool
Filenames []string
Yes bool
}

var (
Expand Down
5 changes: 2 additions & 3 deletions cmd/kops/replace.go
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/resource"
"k8s.io/klog"
"k8s.io/kops/cmd/kops/util"
kopsapi "k8s.io/kops/pkg/apis/kops"
Expand Down Expand Up @@ -56,8 +55,8 @@ var (

// replaceOptions is the options for the command
type replaceOptions struct {
// FilenameOptions is a list of files containing resources
resource.FilenameOptions
// Filenames is a list of files containing resources
Filenames []string
// create any resources not found - we limit to instance groups only for now
force bool
}
Expand Down

0 comments on commit 97c83b6

Please sign in to comment.