From 4574b365f912bc706bc48f894e8a9374985a8e01 Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Mon, 26 Aug 2019 09:09:40 -0700 Subject: [PATCH] Rename --experimental-* flags to --* for server-side apply Kubernetes-commit: a3f4e6e933d3292b3921cdc7b60d7ae019ca1580 --- pkg/cmd/apply/apply.go | 4 ++-- pkg/cmd/diff/diff.go | 2 +- pkg/cmd/util/helpers.go | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/cmd/apply/apply.go b/pkg/cmd/apply/apply.go index 9f7a994b3..915f055ea 100644 --- a/pkg/cmd/apply/apply.go +++ b/pkg/cmd/apply/apply.go @@ -204,11 +204,11 @@ func (o *ApplyOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error { o.DryRun = cmdutil.GetDryRunFlag(cmd) if o.ForceConflicts && !o.ServerSideApply { - return fmt.Errorf("--experimental-force-conflicts only works with --experimental-server-side") + return fmt.Errorf("--force-conflicts only works with --server-side") } if o.DryRun && o.ServerSideApply { - return fmt.Errorf("--dry-run doesn't work with --experimental-server-side (did you mean --server-dry-run instead?)") + return fmt.Errorf("--dry-run doesn't work with --server-side (did you mean --server-dry-run instead?)") } if o.DryRun && o.ServerDryRun { diff --git a/pkg/cmd/diff/diff.go b/pkg/cmd/diff/diff.go index e64df1ddb..f8f114a07 100644 --- a/pkg/cmd/diff/diff.go +++ b/pkg/cmd/diff/diff.go @@ -402,7 +402,7 @@ func (o *DiffOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error { o.ServerSideApply = cmdutil.GetServerSideApplyFlag(cmd) o.ForceConflicts = cmdutil.GetForceConflictsFlag(cmd) if o.ForceConflicts && !o.ServerSideApply { - return fmt.Errorf("--experimental-force-conflicts only works with --experimental-server-side") + return fmt.Errorf("--force-conflicts only works with --server-side") } if !o.ServerSideApply { diff --git a/pkg/cmd/util/helpers.go b/pkg/cmd/util/helpers.go index 9d27003e4..0659eabf3 100644 --- a/pkg/cmd/util/helpers.go +++ b/pkg/cmd/util/helpers.go @@ -26,7 +26,7 @@ import ( "strings" "time" - "github.com/evanphx/json-patch" + jsonpatch "github.com/evanphx/json-patch" "github.com/spf13/cobra" "github.com/spf13/pflag" kerrors "k8s.io/apimachinery/pkg/api/errors" @@ -409,9 +409,9 @@ func AddDryRunFlag(cmd *cobra.Command) { } func AddServerSideApplyFlags(cmd *cobra.Command) { - cmd.Flags().Bool("experimental-server-side", false, "If true, apply runs in the server instead of the client. This is an alpha feature and flag.") - cmd.Flags().Bool("experimental-force-conflicts", false, "If true, server-side apply will force the changes against conflicts. This is an alpha feature and flag.") - cmd.Flags().String("experimental-field-manager", "kubectl", "Name of the manager used to track field ownership. This is an alpha feature and flag.") + cmd.Flags().Bool("server-side", false, "If true, apply runs in the server instead of the client.") + cmd.Flags().Bool("force-conflicts", false, "If true, server-side apply will force the changes against conflicts.") + cmd.Flags().String("field-manager", "kubectl", "Name of the manager used to track field ownership.") } func AddIncludeUninitializedFlag(cmd *cobra.Command) { @@ -488,15 +488,15 @@ func DumpReaderToFile(reader io.Reader, filename string) error { } func GetServerSideApplyFlag(cmd *cobra.Command) bool { - return GetFlagBool(cmd, "experimental-server-side") + return GetFlagBool(cmd, "server-side") } func GetForceConflictsFlag(cmd *cobra.Command) bool { - return GetFlagBool(cmd, "experimental-force-conflicts") + return GetFlagBool(cmd, "force-conflicts") } func GetFieldManagerFlag(cmd *cobra.Command) string { - return GetFlagString(cmd, "experimental-field-manager") + return GetFlagString(cmd, "field-manager") } func GetDryRunFlag(cmd *cobra.Command) bool {