Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Remove fluxctl's --service flags and list-services command
Browse files Browse the repository at this point in the history
They were deprecated and leading to an error when used.
  • Loading branch information
2opremio authored and Alfonso Acosta committed Mar 4, 2019
1 parent b625c13 commit e067647
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 95 deletions.
8 changes: 0 additions & 8 deletions cmd/fluxctl/automate_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type workloadAutomateOpts struct {
outputOpts
cause update.Cause

// Deprecated
service string
// Deprecated
controller string
}
Expand All @@ -37,9 +35,6 @@ func (opts *workloadAutomateOpts) Command() *cobra.Command {
cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Workload namespace")
cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Workload to automate")

// Deprecated
cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to automate")
cmd.Flags().MarkHidden("service")
// Deprecated
cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Controller to automate")
cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
Expand All @@ -48,9 +43,6 @@ func (opts *workloadAutomateOpts) Command() *cobra.Command {
}

func (opts *workloadAutomateOpts) RunE(cmd *cobra.Command, args []string) error {
if len(opts.service) > 0 {
return errorServiceFlagDeprecated
}
// Backwards compatibility with --controller until we remove it
switch {
case opts.workload != "" && opts.controller != "":
Expand Down
8 changes: 0 additions & 8 deletions cmd/fluxctl/deautomate_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type workloadDeautomateOpts struct {
outputOpts
cause update.Cause

// Deprecated
service string
// Deprecated
controller string
}
Expand All @@ -37,9 +35,6 @@ func (opts *workloadDeautomateOpts) Command() *cobra.Command {
cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Workload namespace")
cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Workload to deautomate")

// Deprecated
cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to deautomate")
cmd.Flags().MarkHidden("service")
// Deprecated
cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Controller to deautomate")
cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
Expand All @@ -48,9 +43,6 @@ func (opts *workloadDeautomateOpts) Command() *cobra.Command {
}

func (opts *workloadDeautomateOpts) RunE(cmd *cobra.Command, args []string) error {
if len(opts.service) > 0 {
return errorServiceFlagDeprecated
}
// Backwards compatibility with --controller until we remove it
switch {
case opts.workload != "" && opts.controller != "":
Expand Down
5 changes: 1 addition & 4 deletions cmd/fluxctl/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,4 @@ func checkExactlyOne(optsDescription string, supplied ...bool) error {
return nil
}

var (
errorWantedNoArgs = newUsageError("expected no (non-flag) arguments")
errorServiceFlagDeprecated = newUsageError("--service is deprecated, use --workload instead")
)
var errorWantedNoArgs = newUsageError("expected no (non-flag) arguments")
8 changes: 0 additions & 8 deletions cmd/fluxctl/list_images_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ type imageListOpts struct {
workload string
limit int

// Deprecated
service string
// Deprecated
controller string
}
Expand All @@ -42,9 +40,6 @@ func (opts *imageListOpts) Command() *cobra.Command {
cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Show images for this workload")
cmd.Flags().IntVarP(&opts.limit, "limit", "l", 10, "Number of images to show (0 for all)")

// Deprecated
cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Show images for this service")
cmd.Flags().MarkHidden("service")
// Deprecated
cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Show images for this controller")
cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
Expand All @@ -53,9 +48,6 @@ func (opts *imageListOpts) Command() *cobra.Command {
}

func (opts *imageListOpts) RunE(cmd *cobra.Command, args []string) error {
if len(opts.service) > 0 {
return errorServiceFlagDeprecated
}
if len(args) != 0 {
return errorWantedNoArgs
}
Expand Down
31 changes: 0 additions & 31 deletions cmd/fluxctl/list_services_cmd.go

This file was deleted.

9 changes: 0 additions & 9 deletions cmd/fluxctl/lock_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type workloadLockOpts struct {
outputOpts
cause update.Cause

// Deprecated
service string
// Deprecated
controller string
}
Expand All @@ -37,9 +35,6 @@ func (opts *workloadLockOpts) Command() *cobra.Command {
cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Controller namespace")
cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Workload to lock")

// Deprecated
cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to lock")
cmd.Flags().MarkHidden("service")
// Deprecated
cmd.Flags().StringVarP(&opts.workload, "controller", "c", "", "Controller to lock")
cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
Expand All @@ -48,10 +43,6 @@ func (opts *workloadLockOpts) Command() *cobra.Command {
}

func (opts *workloadLockOpts) RunE(cmd *cobra.Command, args []string) error {
if len(opts.service) > 0 {
return errorServiceFlagDeprecated
}

// Backwards compatibility with --controller until we remove it
switch {
case opts.workload != "" && opts.controller != "":
Expand Down
8 changes: 0 additions & 8 deletions cmd/fluxctl/policy_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ type workloadPolicyOpts struct {

cause update.Cause

// Deprecated
service string
// Deprecated
controller string
}
Expand Down Expand Up @@ -70,9 +68,6 @@ containers which aren't explicitly named.
flags.BoolVar(&opts.lock, "lock", false, "Lock workload")
flags.BoolVar(&opts.unlock, "unlock", false, "Unlock workload")

// Deprecated
flags.StringVarP(&opts.service, "service", "s", "", "Service to modify")
flags.MarkHidden("service")
// Deprecated
flags.StringVarP(&opts.controller, "controller", "c", "", "Controller to modify")
flags.MarkDeprecated("controller", "changed to --workspace, use that instead")
Expand All @@ -81,9 +76,6 @@ containers which aren't explicitly named.
}

func (opts *workloadPolicyOpts) RunE(cmd *cobra.Command, args []string) error {
if len(opts.service) > 0 {
return errorServiceFlagDeprecated
}
if len(args) > 0 {
return errorWantedNoArgs
}
Expand Down
9 changes: 0 additions & 9 deletions cmd/fluxctl/release_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ type workloadReleaseOpts struct {
outputOpts
cause update.Cause

// Deprecated
services []string
// Deprecated
controllers []string
}
Expand Down Expand Up @@ -67,9 +65,6 @@ func (opts *workloadReleaseOpts) Command() *cobra.Command {
cmd.Flags().BoolVarP(&opts.force, "force", "f", false, "Disregard locks and container image filters (has no effect when used with --all or --update-all-images)")
cmd.Flags().BoolVarP(&opts.watch, "watch", "w", false, "Watch rollout progress during release")

// Deprecated
cmd.Flags().StringSliceVarP(&opts.services, "service", "s", []string{}, "Service to release")
cmd.Flags().MarkHidden("service")
// Deprecated
cmd.Flags().StringSliceVarP(&opts.controllers, "controller", "c", []string{}, "List of controllers to release <namespace>:<kind>/<name>")
cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
Expand All @@ -78,10 +73,6 @@ func (opts *workloadReleaseOpts) Command() *cobra.Command {
}

func (opts *workloadReleaseOpts) RunE(cmd *cobra.Command, args []string) error {
if len(opts.services) > 0 {
return errorServiceFlagDeprecated
}

if len(args) != 0 {
return errorWantedNoArgs
}
Expand Down
1 change: 0 additions & 1 deletion cmd/fluxctl/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func (opts *rootOpts) Command() *cobra.Command {

cmd.AddCommand(
newVersionCommand(),
newServiceList(opts).Command(),
newImageList(opts).Command(),
newWorkloadList(opts).Command(),
newWorkloadRelease(opts).Command(),
Expand Down
9 changes: 0 additions & 9 deletions cmd/fluxctl/unlock_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type workloadUnlockOpts struct {
outputOpts
cause update.Cause

// Deprecated
service string
// Deprecated
controller string
}
Expand All @@ -37,9 +35,6 @@ func (opts *workloadUnlockOpts) Command() *cobra.Command {
cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Controller namespace")
cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Controller to unlock")

// Deprecated
cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to unlock")
cmd.Flags().MarkHidden("service")
// Deprecated
cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Controller to unlock")
cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
Expand All @@ -48,10 +43,6 @@ func (opts *workloadUnlockOpts) Command() *cobra.Command {
}

func (opts *workloadUnlockOpts) RunE(cmd *cobra.Command, args []string) error {
if len(opts.service) > 0 {
return errorServiceFlagDeprecated
}

// Backwards compatibility with --controller until we remove it
switch {
case opts.workload != "" && opts.controller != "":
Expand Down

0 comments on commit e067647

Please sign in to comment.