Rename --experimental-* flags to --* for server-side apply

Kubernetes-commit: a3f4e6e933d3292b3921cdc7b60d7ae019ca1580
This commit is contained in:
Antoine Pelisse 2019-08-26 09:09:40 -07:00 committed by Kubernetes Publisher
parent bd0a1a2bd5
commit 4574b365f9
3 changed files with 10 additions and 10 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {