mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Generalize dry run verify to arbitrary query param
This commit is contained in:
parent
a41f9e976d
commit
d6c83281bc
@ -21,19 +21,104 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
|
openapi_v2 "github.com/googleapis/gnostic/openapiv2"
|
||||||
yaml "gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/client-go/discovery"
|
"k8s.io/client-go/discovery"
|
||||||
"k8s.io/client-go/dynamic"
|
"k8s.io/client-go/dynamic"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewDryRunVerifier(dynamicClient dynamic.Interface, openAPIGetter discovery.OpenAPISchemaInterface) *DryRunVerifier {
|
func NewQueryParamVerifier(dynamicClient dynamic.Interface, openAPIGetter discovery.OpenAPISchemaInterface, queryParam VerifiableQueryParam) *QueryParamVerifier {
|
||||||
return &DryRunVerifier{
|
return &QueryParamVerifier{
|
||||||
finder: NewCRDFinder(CRDFromDynamic(dynamicClient)),
|
finder: NewCRDFinder(CRDFromDynamic(dynamicClient)),
|
||||||
openAPIGetter: openAPIGetter,
|
openAPIGetter: openAPIGetter,
|
||||||
|
queryParam: queryParam,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QueryParamVerifier verifies if a given group-version-kind supports a
|
||||||
|
// given VerifiableQueryParam against the current server.
|
||||||
|
//
|
||||||
|
// Currently supported query params are:
|
||||||
|
// 1. dryRun
|
||||||
|
// 2. fieldValidation
|
||||||
|
//
|
||||||
|
// Support for each of these query params needs to be verified because:
|
||||||
|
//
|
||||||
|
// 1. Sending dryRun requests to apiserver that
|
||||||
|
// don't support it will result in objects being unwillingly persisted.
|
||||||
|
//
|
||||||
|
// 2. We determine whether or not to perform server-side or client-side
|
||||||
|
// schema validation based on whether the fieldValidation query param is
|
||||||
|
// supported or not.
|
||||||
|
//
|
||||||
|
// It reads the OpenAPI to see if the given GVK supports the given query param.
|
||||||
|
// If the GVK can not be found, we assume that CRDs will have the same level of
|
||||||
|
// support as "namespaces", and non-CRDs will not be supported. We
|
||||||
|
// delay the check for CRDs as much as possible though, since it
|
||||||
|
// requires an extra round-trip to the server.
|
||||||
|
type QueryParamVerifier struct {
|
||||||
|
finder CRDFinder
|
||||||
|
openAPIGetter discovery.OpenAPISchemaInterface
|
||||||
|
queryParam VerifiableQueryParam
|
||||||
|
}
|
||||||
|
|
||||||
|
// VerifiableQueryParam is a query parameter who's enablement on the
|
||||||
|
// apiserver can be determined by evaluating the OpenAPI for a specific
|
||||||
|
// GVK.
|
||||||
|
type VerifiableQueryParam string
|
||||||
|
|
||||||
|
const (
|
||||||
|
QueryParamDryRun VerifiableQueryParam = "dryRun"
|
||||||
|
QueryParamFieldValidation VerifiableQueryParam = "fieldValidation"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (v *QueryParamVerifier) HasSupport(gvk schema.GroupVersionKind) error {
|
||||||
|
oapi, err := v.openAPIGetter.OpenAPISchema()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to download openapi: %v", err)
|
||||||
|
}
|
||||||
|
supports, err := supportsQueryParam(oapi, gvk, v.queryParam)
|
||||||
|
if err != nil {
|
||||||
|
// We assume that we couldn't find the type, then check for namespace:
|
||||||
|
supports, _ = supportsQueryParam(oapi, schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"}, v.queryParam)
|
||||||
|
// If namespace supports the query param, then we will support the query param for CRDs only.
|
||||||
|
if supports {
|
||||||
|
supports, err = v.finder.HasCRD(gvk.GroupKind())
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to check CRD: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !supports {
|
||||||
|
return newParamUnsupportedError(gvk, v.queryParam)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type paramUnsupportedError struct {
|
||||||
|
gvk schema.GroupVersionKind
|
||||||
|
param VerifiableQueryParam
|
||||||
|
}
|
||||||
|
|
||||||
|
func newParamUnsupportedError(gvk schema.GroupVersionKind, param VerifiableQueryParam) error {
|
||||||
|
return ¶mUnsupportedError{
|
||||||
|
gvk: gvk,
|
||||||
|
param: param,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *paramUnsupportedError) Error() string {
|
||||||
|
return fmt.Sprintf("%v doesn't support %s", e.gvk, e.param)
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsParamUnsupportedError(err error) bool {
|
||||||
|
if err == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
_, ok := err.(*paramUnsupportedError)
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
func hasGVKExtension(extensions []*openapi_v2.NamedAny, gvk schema.GroupVersionKind) bool {
|
func hasGVKExtension(extensions []*openapi_v2.NamedAny, gvk schema.GroupVersionKind) bool {
|
||||||
for _, extension := range extensions {
|
for _, extension := range extensions {
|
||||||
if extension.GetValue().GetYaml() == "" ||
|
if extension.GetValue().GetYaml() == "" ||
|
||||||
@ -54,56 +139,17 @@ func hasGVKExtension(extensions []*openapi_v2.NamedAny, gvk schema.GroupVersionK
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// DryRunVerifier verifies if a given group-version-kind supports DryRun
|
// supportsQueryParam is a method that let's us look in the OpenAPI if the
|
||||||
// against the current server. Sending dryRun requests to apiserver that
|
// specific group-version-kind supports the specific query parameter for
|
||||||
// don't support it will result in objects being unwillingly persisted.
|
|
||||||
//
|
|
||||||
// It reads the OpenAPI to see if the given GVK supports dryRun. If the
|
|
||||||
// GVK can not be found, we assume that CRDs will have the same level of
|
|
||||||
// support as "namespaces", and non-CRDs will not be supported. We
|
|
||||||
// delay the check for CRDs as much as possible though, since it
|
|
||||||
// requires an extra round-trip to the server.
|
|
||||||
type DryRunVerifier struct {
|
|
||||||
finder CRDFinder
|
|
||||||
openAPIGetter discovery.OpenAPISchemaInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasSupport verifies if the given gvk supports DryRun. An error is
|
|
||||||
// returned if it doesn't.
|
|
||||||
func (v *DryRunVerifier) HasSupport(gvk schema.GroupVersionKind) error {
|
|
||||||
oapi, err := v.openAPIGetter.OpenAPISchema()
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("failed to download openapi: %v", err)
|
|
||||||
}
|
|
||||||
supports, err := supportsDryRun(oapi, gvk)
|
|
||||||
if err != nil {
|
|
||||||
// We assume that we couldn't find the type, then check for namespace:
|
|
||||||
supports, _ = supportsDryRun(oapi, schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"})
|
|
||||||
// If namespace supports dryRun, then we will support dryRun for CRDs only.
|
|
||||||
if supports {
|
|
||||||
supports, err = v.finder.HasCRD(gvk.GroupKind())
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("failed to check CRD: %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !supports {
|
|
||||||
return fmt.Errorf("%v doesn't support dry-run", gvk)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// supportsDryRun is a method that let's us look in the OpenAPI if the
|
|
||||||
// specific group-version-kind supports the dryRun query parameter for
|
|
||||||
// the PATCH end-point.
|
// the PATCH end-point.
|
||||||
func supportsDryRun(doc *openapi_v2.Document, gvk schema.GroupVersionKind) (bool, error) {
|
func supportsQueryParam(doc *openapi_v2.Document, gvk schema.GroupVersionKind, queryParam VerifiableQueryParam) (bool, error) {
|
||||||
for _, path := range doc.GetPaths().GetPath() {
|
for _, path := range doc.GetPaths().GetPath() {
|
||||||
// Is this describing the gvk we're looking for?
|
// Is this describing the gvk we're looking for?
|
||||||
if !hasGVKExtension(path.GetValue().GetPatch().GetVendorExtension(), gvk) {
|
if !hasGVKExtension(path.GetValue().GetPatch().GetVendorExtension(), gvk) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, param := range path.GetValue().GetPatch().GetParameters() {
|
for _, param := range path.GetValue().GetPatch().GetParameters() {
|
||||||
if param.GetParameter().GetNonBodyParameter().GetQueryParameterSubSchema().GetName() == "dryRun" {
|
if param.GetParameter().GetNonBodyParameter().GetQueryParameterSubSchema().GetName() == string(queryParam) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -66,7 +66,7 @@ func TestSupportsDryRun(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
supports, err := supportsDryRun(doc, test.gvk)
|
supports, err := supportsQueryParam(doc, test.gvk, QueryParamDryRun)
|
||||||
if supports != test.supports || ((err == nil) != test.success) {
|
if supports != test.supports || ((err == nil) != test.success) {
|
||||||
errStr := "nil"
|
errStr := "nil"
|
||||||
if test.success == false {
|
if test.success == false {
|
||||||
@ -84,7 +84,7 @@ func TestSupportsDryRun(t *testing.T) {
|
|||||||
var fakeSchema = openapitesting.Fake{Path: filepath.Join("..", "..", "artifacts", "openapi", "swagger.json")}
|
var fakeSchema = openapitesting.Fake{Path: filepath.Join("..", "..", "artifacts", "openapi", "swagger.json")}
|
||||||
|
|
||||||
func TestDryRunVerifier(t *testing.T) {
|
func TestDryRunVerifier(t *testing.T) {
|
||||||
dryRunVerifier := DryRunVerifier{
|
dryRunVerifier := QueryParamVerifier{
|
||||||
finder: NewCRDFinder(func() ([]schema.GroupKind, error) {
|
finder: NewCRDFinder(func() ([]schema.GroupKind, error) {
|
||||||
return []schema.GroupKind{
|
return []schema.GroupKind{
|
||||||
{
|
{
|
||||||
@ -98,6 +98,7 @@ func TestDryRunVerifier(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
}),
|
}),
|
||||||
openAPIGetter: &fakeSchema,
|
openAPIGetter: &fakeSchema,
|
||||||
|
queryParam: QueryParamDryRun,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := dryRunVerifier.HasSupport(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "NodeProxyOptions"})
|
err := dryRunVerifier.HasSupport(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "NodeProxyOptions"})
|
||||||
@ -128,7 +129,7 @@ func (EmptyOpenAPI) OpenAPISchema() (*openapi_v2.Document, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDryRunVerifierNoOpenAPI(t *testing.T) {
|
func TestDryRunVerifierNoOpenAPI(t *testing.T) {
|
||||||
dryRunVerifier := DryRunVerifier{
|
dryRunVerifier := QueryParamVerifier{
|
||||||
finder: NewCRDFinder(func() ([]schema.GroupKind, error) {
|
finder: NewCRDFinder(func() ([]schema.GroupKind, error) {
|
||||||
return []schema.GroupKind{
|
return []schema.GroupKind{
|
||||||
{
|
{
|
||||||
@ -142,6 +143,7 @@ func TestDryRunVerifierNoOpenAPI(t *testing.T) {
|
|||||||
}, nil
|
}, nil
|
||||||
}),
|
}),
|
||||||
openAPIGetter: EmptyOpenAPI{},
|
openAPIGetter: EmptyOpenAPI{},
|
||||||
|
queryParam: QueryParamDryRun,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := dryRunVerifier.HasSupport(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"})
|
err := dryRunVerifier.HasSupport(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"})
|
@ -57,7 +57,7 @@ type AnnotateOptions struct {
|
|||||||
list bool
|
list bool
|
||||||
local bool
|
local bool
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
fieldManager string
|
fieldManager string
|
||||||
all bool
|
all bool
|
||||||
allNamespaces bool
|
allNamespaces bool
|
||||||
@ -182,7 +182,7 @@ func (o *AnnotateOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.dryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.dryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -85,7 +85,7 @@ type ApplyOptions struct {
|
|||||||
FieldManager string
|
FieldManager string
|
||||||
Selector string
|
Selector string
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
Prune bool
|
Prune bool
|
||||||
PruneResources []prune.Resource
|
PruneResources []prune.Resource
|
||||||
cmdBaseName string
|
cmdBaseName string
|
||||||
@ -237,7 +237,7 @@ func (flags *ApplyFlags) ToOptions(cmd *cobra.Command, baseName string, args []s
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
dryRunVerifier := resource.NewDryRunVerifier(dynamicClient, flags.Factory.OpenAPIGetter())
|
dryRunVerifier := resource.NewQueryParamVerifier(dynamicClient, flags.Factory.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
fieldManager := GetApplyFieldManagerFlag(cmd, serverSideApply)
|
fieldManager := GetApplyFieldManagerFlag(cmd, serverSideApply)
|
||||||
|
|
||||||
// allow for a success message operation to be specified at print time
|
// allow for a success message operation to be specified at print time
|
||||||
|
@ -50,7 +50,7 @@ type SetLastAppliedOptions struct {
|
|||||||
namespace string
|
namespace string
|
||||||
enforceNamespace bool
|
enforceNamespace bool
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
shortOutput bool
|
shortOutput bool
|
||||||
output string
|
output string
|
||||||
patchBufferList []PatchBuffer
|
patchBufferList []PatchBuffer
|
||||||
@ -128,7 +128,7 @@ func (o *SetLastAppliedOptions) Complete(f cmdutil.Factory, cmd *cobra.Command)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
o.output = cmdutil.GetFlagString(cmd, "output")
|
o.output = cmdutil.GetFlagString(cmd, "output")
|
||||||
o.shortOutput = o.output == "name"
|
o.shortOutput = o.output == "name"
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ type AutoscaleOptions struct {
|
|||||||
enforceNamespace bool
|
enforceNamespace bool
|
||||||
namespace string
|
namespace string
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
builder *resource.Builder
|
builder *resource.Builder
|
||||||
fieldManager string
|
fieldManager string
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ func (o *AutoscaleOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
o.createAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
o.createAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
||||||
o.builder = f.NewBuilder()
|
o.builder = f.NewBuilder()
|
||||||
o.scaleKindResolver = scale.NewDiscoveryScaleKindResolver(discoveryClient)
|
o.scaleKindResolver = scale.NewDiscoveryScaleKindResolver(discoveryClient)
|
||||||
|
@ -52,7 +52,7 @@ type CreateOptions struct {
|
|||||||
RecordFlags *genericclioptions.RecordFlags
|
RecordFlags *genericclioptions.RecordFlags
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
fieldManager string
|
fieldManager string
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ func (o *CreateOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -344,7 +344,7 @@ type CreateSubcommandOptions struct {
|
|||||||
// StructuredGenerator is the resource generator for the object being created
|
// StructuredGenerator is the resource generator for the object being created
|
||||||
StructuredGenerator generate.StructuredGenerator
|
StructuredGenerator generate.StructuredGenerator
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
CreateAnnotation bool
|
CreateAnnotation bool
|
||||||
FieldManager string
|
FieldManager string
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ func (o *CreateSubcommandOptions) Complete(f cmdutil.Factory, cmd *cobra.Command
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
o.CreateAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
o.CreateAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
||||||
|
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
@ -61,7 +61,7 @@ type ClusterRoleBindingOptions struct {
|
|||||||
|
|
||||||
Client rbacclientv1.RbacV1Interface
|
Client rbacclientv1.RbacV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ func (o *ClusterRoleBindingOptions) Complete(f cmdutil.Factory, cmd *cobra.Comma
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -98,7 +98,7 @@ type ConfigMapOptions struct {
|
|||||||
|
|
||||||
Client corev1client.CoreV1Interface
|
Client corev1client.CoreV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -173,13 +173,12 @@ func (o *ConfigMapOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
discoveryClient, err := f.ToDiscoveryClient()
|
discoveryClient, err := f.ToDiscoveryClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, discoveryClient)
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, discoveryClient, resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -64,7 +64,7 @@ type CreateCronJobOptions struct {
|
|||||||
EnforceNamespace bool
|
EnforceNamespace bool
|
||||||
Client batchv1client.BatchV1Interface
|
Client batchv1client.BatchV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
Builder *resource.Builder
|
Builder *resource.Builder
|
||||||
FieldManager string
|
FieldManager string
|
||||||
CreateAnnotation bool
|
CreateAnnotation bool
|
||||||
@ -150,7 +150,7 @@ func (o *CreateCronJobOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, a
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -74,7 +74,7 @@ type CreateDeploymentOptions struct {
|
|||||||
|
|
||||||
Client appsv1client.AppsV1Interface
|
Client appsv1client.AppsV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ func (o *CreateDeploymentOptions) Complete(f cmdutil.Factory, cmd *cobra.Command
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -118,7 +118,7 @@ type CreateIngressOptions struct {
|
|||||||
|
|
||||||
Client networkingv1client.NetworkingV1Interface
|
Client networkingv1client.NetworkingV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
FieldManager string
|
FieldManager string
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ func (o *CreateIngressOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, a
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -66,7 +66,7 @@ type CreateJobOptions struct {
|
|||||||
EnforceNamespace bool
|
EnforceNamespace bool
|
||||||
Client batchv1client.BatchV1Interface
|
Client batchv1client.BatchV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
Builder *resource.Builder
|
Builder *resource.Builder
|
||||||
FieldManager string
|
FieldManager string
|
||||||
CreateAnnotation bool
|
CreateAnnotation bool
|
||||||
@ -145,7 +145,7 @@ func (o *CreateJobOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -19,6 +19,7 @@ package create
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -52,7 +53,7 @@ type NamespaceOptions struct {
|
|||||||
Name string
|
Name string
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
CreateAnnotation bool
|
CreateAnnotation bool
|
||||||
FieldManager string
|
FieldManager string
|
||||||
|
|
||||||
@ -129,7 +130,7 @@ func (o *NamespaceOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, discoveryClient)
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, discoveryClient, resource.QueryParamDryRun)
|
||||||
o.CreateAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
o.CreateAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||||
|
"k8s.io/cli-runtime/pkg/resource"
|
||||||
resourcecli "k8s.io/cli-runtime/pkg/resource"
|
resourcecli "k8s.io/cli-runtime/pkg/resource"
|
||||||
policyv1client "k8s.io/client-go/kubernetes/typed/policy/v1"
|
policyv1client "k8s.io/client-go/kubernetes/typed/policy/v1"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
@ -71,7 +72,7 @@ type PodDisruptionBudgetOpts struct {
|
|||||||
|
|
||||||
Client *policyv1client.PolicyV1Client
|
Client *policyv1client.PolicyV1Client
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resourcecli.DryRunVerifier
|
DryRunVerifier *resourcecli.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -146,7 +147,7 @@ func (o *PodDisruptionBudgetOpts) Complete(f cmdutil.Factory, cmd *cobra.Command
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resourcecli.NewDryRunVerifier(dynamicClient, discoveryClient)
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, discoveryClient, resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -66,7 +66,7 @@ type PriorityClassOptions struct {
|
|||||||
|
|
||||||
Client *schedulingv1client.SchedulingV1Client
|
Client *schedulingv1client.SchedulingV1Client
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ func (o *PriorityClassOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, a
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -28,6 +28,7 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||||
|
"k8s.io/cli-runtime/pkg/resource"
|
||||||
resourcecli "k8s.io/cli-runtime/pkg/resource"
|
resourcecli "k8s.io/cli-runtime/pkg/resource"
|
||||||
coreclient "k8s.io/client-go/kubernetes/typed/core/v1"
|
coreclient "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
@ -67,7 +68,7 @@ type QuotaOpts struct {
|
|||||||
|
|
||||||
Client *coreclient.CoreV1Client
|
Client *coreclient.CoreV1Client
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resourcecli.DryRunVerifier
|
DryRunVerifier *resourcecli.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -136,7 +137,7 @@ func (o *QuotaOpts) Complete(f cmdutil.Factory, cmd *cobra.Command, args []strin
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resourcecli.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resourcecli.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -137,7 +137,7 @@ type CreateRoleOptions struct {
|
|||||||
ResourceNames []string
|
ResourceNames []string
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
OutputFormat string
|
OutputFormat string
|
||||||
Namespace string
|
Namespace string
|
||||||
EnforceNamespace bool
|
EnforceNamespace bool
|
||||||
@ -258,7 +258,7 @@ func (o *CreateRoleOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
o.OutputFormat = cmdutil.GetFlagString(cmd, "output")
|
o.OutputFormat = cmdutil.GetFlagString(cmd, "output")
|
||||||
o.CreateAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
o.CreateAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ type RoleBindingOptions struct {
|
|||||||
|
|
||||||
Client rbacclientv1.RbacV1Interface
|
Client rbacclientv1.RbacV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -136,11 +136,11 @@ func (o *RoleBindingOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, arg
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
dynamicCient, err := f.DynamicClient()
|
dynamicClient, err := f.DynamicClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicCient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -114,7 +114,7 @@ type CreateSecretOptions struct {
|
|||||||
|
|
||||||
Client corev1client.CoreV1Interface
|
Client corev1client.CoreV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ func (o *CreateSecretOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, ar
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, discoveryClient)
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, discoveryClient, resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -110,7 +110,7 @@ type CreateSecretDockerRegistryOptions struct {
|
|||||||
|
|
||||||
Client corev1client.CoreV1Interface
|
Client corev1client.CoreV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ func (o *CreateSecretDockerRegistryOptions) Complete(f cmdutil.Factory, cmd *cob
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, discoveryClient)
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, discoveryClient, resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -71,7 +71,7 @@ type CreateSecretTLSOptions struct {
|
|||||||
|
|
||||||
Client corev1client.CoreV1Interface
|
Client corev1client.CoreV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ func (o *CreateSecretTLSOptions) Complete(f cmdutil.Factory, cmd *cobra.Command,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, discoveryClient)
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, discoveryClient, resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -76,7 +76,7 @@ type ServiceOptions struct {
|
|||||||
|
|
||||||
Client corev1client.CoreV1Interface
|
Client corev1client.CoreV1Interface
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ func (o *ServiceOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -53,7 +53,7 @@ type ServiceAccountOpts struct {
|
|||||||
// Name of resource being created
|
// Name of resource being created
|
||||||
Name string
|
Name string
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
CreateAnnotation bool
|
CreateAnnotation bool
|
||||||
FieldManager string
|
FieldManager string
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ func (o *ServiceAccountOpts) Complete(f cmdutil.Factory, cmd *cobra.Command, arg
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -121,7 +121,7 @@ type DeleteOptions struct {
|
|||||||
Timeout time.Duration
|
Timeout time.Duration
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
Output string
|
Output string
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ func (o *DeleteOptions) Complete(f cmdutil.Factory, args []string, cmd *cobra.Co
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
if len(o.Raw) == 0 {
|
if len(o.Raw) == 0 {
|
||||||
r := f.NewBuilder().
|
r := f.NewBuilder().
|
||||||
|
@ -112,7 +112,7 @@ type DiffOptions struct {
|
|||||||
OpenAPISchema openapi.Resources
|
OpenAPISchema openapi.Resources
|
||||||
DiscoveryClient discovery.DiscoveryInterface
|
DiscoveryClient discovery.DiscoveryInterface
|
||||||
DynamicClient dynamic.Interface
|
DynamicClient dynamic.Interface
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
CmdNamespace string
|
CmdNamespace string
|
||||||
EnforceNamespace bool
|
EnforceNamespace bool
|
||||||
Builder *resource.Builder
|
Builder *resource.Builder
|
||||||
@ -639,7 +639,7 @@ func (o *DiffOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(o.DynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(o.DynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.CmdNamespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.CmdNamespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -227,7 +227,7 @@ func (o *DrainCmdOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.drainer.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.drainer.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
if o.drainer.Client, err = f.KubernetesClientSet(); err != nil {
|
if o.drainer.Client, err = f.KubernetesClientSet(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -91,7 +91,7 @@ type ExposeServiceOptions struct {
|
|||||||
PrintObj printers.ResourcePrinterFunc
|
PrintObj printers.ResourcePrinterFunc
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
EnforceNamespace bool
|
EnforceNamespace bool
|
||||||
|
|
||||||
fieldManager string
|
fieldManager string
|
||||||
@ -181,7 +181,7 @@ func (o *ExposeServiceOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) e
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -83,7 +83,7 @@ type LabelOptions struct {
|
|||||||
enforceNamespace bool
|
enforceNamespace bool
|
||||||
builder *resource.Builder
|
builder *resource.Builder
|
||||||
unstructuredClientForMapping func(mapping *meta.RESTMapping) (resource.RESTClient, error)
|
unstructuredClientForMapping func(mapping *meta.RESTMapping) (resource.RESTClient, error)
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
// Common shared fields
|
// Common shared fields
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
@ -185,7 +185,7 @@ func (o *LabelOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.dryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.dryRunStrategy)
|
||||||
o.ToPrinter = func(operation string) (printers.ResourcePrinter, error) {
|
o.ToPrinter = func(operation string) (printers.ResourcePrinter, error) {
|
||||||
|
@ -64,7 +64,7 @@ type PatchOptions struct {
|
|||||||
namespace string
|
namespace string
|
||||||
enforceNamespace bool
|
enforceNamespace bool
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
outputFormat string
|
outputFormat string
|
||||||
args []string
|
args []string
|
||||||
builder *resource.Builder
|
builder *resource.Builder
|
||||||
@ -169,7 +169,7 @@ func (o *PatchOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ type ReplaceOptions struct {
|
|||||||
DeleteOptions *delete.DeleteOptions
|
DeleteOptions *delete.DeleteOptions
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
PrintObj func(obj runtime.Object) error
|
PrintObj func(obj runtime.Object) error
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ func (o *ReplaceOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -41,7 +41,7 @@ type UndoOptions struct {
|
|||||||
Builder func() *resource.Builder
|
Builder func() *resource.Builder
|
||||||
ToRevision int64
|
ToRevision int64
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
Resources []string
|
Resources []string
|
||||||
Namespace string
|
Namespace string
|
||||||
LabelSelector string
|
LabelSelector string
|
||||||
@ -117,7 +117,7 @@ func (o *UndoOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []str
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
if o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace(); err != nil {
|
if o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -109,7 +109,7 @@ type RunOptions struct {
|
|||||||
DeleteOptions *cmddelete.DeleteOptions
|
DeleteOptions *cmddelete.DeleteOptions
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
PrintObj func(runtime.Object) error
|
PrintObj func(runtime.Object) error
|
||||||
Recorder genericclioptions.Recorder
|
Recorder genericclioptions.Recorder
|
||||||
@ -218,7 +218,7 @@ func (o *RunOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
attachFlag := cmd.Flags().Lookup("attach")
|
attachFlag := cmd.Flags().Lookup("attach")
|
||||||
if !attachFlag.Changed && o.Interactive {
|
if !attachFlag.Changed && o.Interactive {
|
||||||
|
@ -87,7 +87,7 @@ type ScaleOptions struct {
|
|||||||
unstructuredClientForMapping func(mapping *meta.RESTMapping) (resource.RESTClient, error)
|
unstructuredClientForMapping func(mapping *meta.RESTMapping) (resource.RESTClient, error)
|
||||||
parent string
|
parent string
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ func (o *ScaleOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.namespace, o.enforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
o.namespace, o.enforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -122,7 +122,7 @@ type EnvOptions struct {
|
|||||||
resources []string
|
resources []string
|
||||||
output string
|
output string
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
builder func() *resource.Builder
|
builder func() *resource.Builder
|
||||||
updatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
|
updatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
|
||||||
namespace string
|
namespace string
|
||||||
@ -233,7 +233,7 @@ func (o *EnvOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []stri
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.dryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.dryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -47,7 +47,7 @@ type SetImageOptions struct {
|
|||||||
Infos []*resource.Info
|
Infos []*resource.Info
|
||||||
Selector string
|
Selector string
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
All bool
|
All bool
|
||||||
Output string
|
Output string
|
||||||
Local bool
|
Local bool
|
||||||
@ -158,7 +158,7 @@ func (o *SetImageOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args [
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
o.Output = cmdutil.GetFlagString(cmd, "output")
|
o.Output = cmdutil.GetFlagString(cmd, "output")
|
||||||
o.ResolveImage = ImageResolver
|
o.ResolveImage = ImageResolver
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ type SetResourcesOptions struct {
|
|||||||
|
|
||||||
UpdatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
|
UpdatePodSpecForObject polymorphichelpers.UpdatePodSpecForObjectFunc
|
||||||
Resources []string
|
Resources []string
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
genericclioptions.IOStreams
|
genericclioptions.IOStreams
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ func (o *SetResourcesOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, ar
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -45,7 +45,7 @@ type SetSelectorOptions struct {
|
|||||||
PrintFlags *genericclioptions.PrintFlags
|
PrintFlags *genericclioptions.PrintFlags
|
||||||
RecordFlags *genericclioptions.RecordFlags
|
RecordFlags *genericclioptions.RecordFlags
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
fieldManager string
|
fieldManager string
|
||||||
|
|
||||||
// set by args
|
// set by args
|
||||||
@ -140,7 +140,7 @@ func (o *SetSelectorOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, arg
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
o.resources, o.selector, err = getResourcesAndSelector(args)
|
o.resources, o.selector, err = getResourcesAndSelector(args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -63,7 +63,7 @@ type SetServiceAccountOptions struct {
|
|||||||
|
|
||||||
fileNameOptions resource.FilenameOptions
|
fileNameOptions resource.FilenameOptions
|
||||||
dryRunStrategy cmdutil.DryRunStrategy
|
dryRunStrategy cmdutil.DryRunStrategy
|
||||||
dryRunVerifier *resource.DryRunVerifier
|
dryRunVerifier *resource.QueryParamVerifier
|
||||||
shortOutput bool
|
shortOutput bool
|
||||||
all bool
|
all bool
|
||||||
output string
|
output string
|
||||||
@ -142,7 +142,7 @@ func (o *SetServiceAccountOptions) Complete(f cmdutil.Factory, cmd *cobra.Comman
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.dryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.dryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
o.output = cmdutil.GetFlagString(cmd, "output")
|
o.output = cmdutil.GetFlagString(cmd, "output")
|
||||||
o.updatePodSpecForObject = polymorphichelpers.UpdatePodSpecForObjectFn
|
o.updatePodSpecForObject = polymorphichelpers.UpdatePodSpecForObjectFn
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ type SubjectOptions struct {
|
|||||||
Output string
|
Output string
|
||||||
All bool
|
All bool
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
Local bool
|
Local bool
|
||||||
fieldManager string
|
fieldManager string
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ func (o *SubjectOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
|
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
printer, err := o.PrintFlags.ToPrinter()
|
printer, err := o.PrintFlags.ToPrinter()
|
||||||
|
@ -48,7 +48,7 @@ type TaintOptions struct {
|
|||||||
ToPrinter func(string) (printers.ResourcePrinter, error)
|
ToPrinter func(string) (printers.ResourcePrinter, error)
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
resources []string
|
resources []string
|
||||||
taintsToAdd []v1.Taint
|
taintsToAdd []v1.Taint
|
||||||
@ -147,7 +147,7 @@ func (o *TaintOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, f.OpenAPIGetter())
|
o.DryRunVerifier = resource.NewQueryParamVerifier(dynamicClient, f.OpenAPIGetter(), resource.QueryParamDryRun)
|
||||||
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
|
||||||
|
|
||||||
// retrieves resource and taint args from args
|
// retrieves resource and taint args from args
|
||||||
|
@ -83,7 +83,7 @@ type Helper struct {
|
|||||||
ErrOut io.Writer
|
ErrOut io.Writer
|
||||||
|
|
||||||
DryRunStrategy cmdutil.DryRunStrategy
|
DryRunStrategy cmdutil.DryRunStrategy
|
||||||
DryRunVerifier *resource.DryRunVerifier
|
DryRunVerifier *resource.QueryParamVerifier
|
||||||
|
|
||||||
// OnPodDeletedOrEvicted is called when a pod is evicted/deleted; for printing progress output
|
// OnPodDeletedOrEvicted is called when a pod is evicted/deleted; for printing progress output
|
||||||
OnPodDeletedOrEvicted func(pod *corev1.Pod, usingEviction bool)
|
OnPodDeletedOrEvicted func(pod *corev1.Pod, usingEviction bool)
|
||||||
|
Loading…
Reference in New Issue
Block a user