Browse Source

Remove fluxctl's --service flags and list-services command

They were deprecated and leading to an error when used.
Alfonso Acosta 6 months ago
parent
commit
1ebb19f1b7

+ 0
- 8
cmd/fluxctl/automate_cmd.go View File

@@ -13,8 +13,6 @@ type workloadAutomateOpts struct {
13 13
 	outputOpts
14 14
 	cause update.Cause
15 15
 
16
-	// Deprecated
17
-	service string
18 16
 	// Deprecated
19 17
 	controller string
20 18
 }
@@ -37,9 +35,6 @@ func (opts *workloadAutomateOpts) Command() *cobra.Command {
37 35
 	cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Workload namespace")
38 36
 	cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Workload to automate")
39 37
 
40
-	// Deprecated
41
-	cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to automate")
42
-	cmd.Flags().MarkHidden("service")
43 38
 	// Deprecated
44 39
 	cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Controller to automate")
45 40
 	cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
@@ -48,9 +43,6 @@ func (opts *workloadAutomateOpts) Command() *cobra.Command {
48 43
 }
49 44
 
50 45
 func (opts *workloadAutomateOpts) RunE(cmd *cobra.Command, args []string) error {
51
-	if len(opts.service) > 0 {
52
-		return errorServiceFlagDeprecated
53
-	}
54 46
 	// Backwards compatibility with --controller until we remove it
55 47
 	switch {
56 48
 	case opts.workload != "" && opts.controller != "":

+ 0
- 8
cmd/fluxctl/deautomate_cmd.go View File

@@ -13,8 +13,6 @@ type workloadDeautomateOpts struct {
13 13
 	outputOpts
14 14
 	cause update.Cause
15 15
 
16
-	// Deprecated
17
-	service string
18 16
 	// Deprecated
19 17
 	controller string
20 18
 }
@@ -37,9 +35,6 @@ func (opts *workloadDeautomateOpts) Command() *cobra.Command {
37 35
 	cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Workload namespace")
38 36
 	cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Workload to deautomate")
39 37
 
40
-	// Deprecated
41
-	cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to deautomate")
42
-	cmd.Flags().MarkHidden("service")
43 38
 	// Deprecated
44 39
 	cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Controller to deautomate")
45 40
 	cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
@@ -48,9 +43,6 @@ func (opts *workloadDeautomateOpts) Command() *cobra.Command {
48 43
 }
49 44
 
50 45
 func (opts *workloadDeautomateOpts) RunE(cmd *cobra.Command, args []string) error {
51
-	if len(opts.service) > 0 {
52
-		return errorServiceFlagDeprecated
53
-	}
54 46
 	// Backwards compatibility with --controller until we remove it
55 47
 	switch {
56 48
 	case opts.workload != "" && opts.controller != "":

+ 1
- 4
cmd/fluxctl/error.go View File

@@ -28,7 +28,4 @@ func checkExactlyOne(optsDescription string, supplied ...bool) error {
28 28
 	return nil
29 29
 }
30 30
 
31
-var (
32
-	errorWantedNoArgs          = newUsageError("expected no (non-flag) arguments")
33
-	errorServiceFlagDeprecated = newUsageError("--service is deprecated, use --workload instead")
34
-)
31
+var errorWantedNoArgs = newUsageError("expected no (non-flag) arguments")

+ 0
- 8
cmd/fluxctl/list_images_cmd.go View File

@@ -21,8 +21,6 @@ type imageListOpts struct {
21 21
 	workload  string
22 22
 	limit     int
23 23
 
24
-	// Deprecated
25
-	service string
26 24
 	// Deprecated
27 25
 	controller string
28 26
 }
@@ -42,9 +40,6 @@ func (opts *imageListOpts) Command() *cobra.Command {
42 40
 	cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Show images for this workload")
43 41
 	cmd.Flags().IntVarP(&opts.limit, "limit", "l", 10, "Number of images to show (0 for all)")
44 42
 
45
-	// Deprecated
46
-	cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Show images for this service")
47
-	cmd.Flags().MarkHidden("service")
48 43
 	// Deprecated
49 44
 	cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Show images for this controller")
50 45
 	cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
@@ -53,9 +48,6 @@ func (opts *imageListOpts) Command() *cobra.Command {
53 48
 }
54 49
 
55 50
 func (opts *imageListOpts) RunE(cmd *cobra.Command, args []string) error {
56
-	if len(opts.service) > 0 {
57
-		return errorServiceFlagDeprecated
58
-	}
59 51
 	if len(args) != 0 {
60 52
 		return errorWantedNoArgs
61 53
 	}

+ 0
- 31
cmd/fluxctl/list_services_cmd.go View File

@@ -1,31 +0,0 @@
1
-package main
2
-
3
-import (
4
-	"errors"
5
-
6
-	"github.com/spf13/cobra"
7
-)
8
-
9
-type serviceListOpts struct {
10
-	*rootOpts
11
-	namespace string
12
-}
13
-
14
-func newServiceList(parent *rootOpts) *serviceListOpts {
15
-	return &serviceListOpts{rootOpts: parent}
16
-}
17
-
18
-func (opts *serviceListOpts) Command() *cobra.Command {
19
-	cmd := &cobra.Command{
20
-		Use:    "list-services",
21
-		Short:  "Deprecated - use list-workloads instead",
22
-		Hidden: true,
23
-		RunE:   opts.RunE,
24
-	}
25
-	cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "", "Namespace to query, blank for all namespaces")
26
-	return cmd
27
-}
28
-
29
-func (opts *serviceListOpts) RunE(cmd *cobra.Command, args []string) error {
30
-	return errors.New("list-services is deprecated, use list-workloads instead")
31
-}

+ 0
- 9
cmd/fluxctl/lock_cmd.go View File

@@ -13,8 +13,6 @@ type workloadLockOpts struct {
13 13
 	outputOpts
14 14
 	cause update.Cause
15 15
 
16
-	// Deprecated
17
-	service string
18 16
 	// Deprecated
19 17
 	controller string
20 18
 }
@@ -37,9 +35,6 @@ func (opts *workloadLockOpts) Command() *cobra.Command {
37 35
 	cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Controller namespace")
38 36
 	cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Workload to lock")
39 37
 
40
-	// Deprecated
41
-	cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to lock")
42
-	cmd.Flags().MarkHidden("service")
43 38
 	// Deprecated
44 39
 	cmd.Flags().StringVarP(&opts.workload, "controller", "c", "", "Controller to lock")
45 40
 	cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
@@ -48,10 +43,6 @@ func (opts *workloadLockOpts) Command() *cobra.Command {
48 43
 }
49 44
 
50 45
 func (opts *workloadLockOpts) RunE(cmd *cobra.Command, args []string) error {
51
-	if len(opts.service) > 0 {
52
-		return errorServiceFlagDeprecated
53
-	}
54
-
55 46
 	// Backwards compatibility with --controller until we remove it
56 47
 	switch {
57 48
 	case opts.workload != "" && opts.controller != "":

+ 0
- 8
cmd/fluxctl/policy_cmd.go View File

@@ -25,8 +25,6 @@ type workloadPolicyOpts struct {
25 25
 
26 26
 	cause update.Cause
27 27
 
28
-	// Deprecated
29
-	service string
30 28
 	// Deprecated
31 29
 	controller string
32 30
 }
@@ -70,9 +68,6 @@ containers which aren't explicitly named.
70 68
 	flags.BoolVar(&opts.lock, "lock", false, "Lock workload")
71 69
 	flags.BoolVar(&opts.unlock, "unlock", false, "Unlock workload")
72 70
 
73
-	// Deprecated
74
-	flags.StringVarP(&opts.service, "service", "s", "", "Service to modify")
75
-	flags.MarkHidden("service")
76 71
 	// Deprecated
77 72
 	flags.StringVarP(&opts.controller, "controller", "c", "", "Controller to modify")
78 73
 	flags.MarkDeprecated("controller", "changed to --workspace, use that instead")
@@ -81,9 +76,6 @@ containers which aren't explicitly named.
81 76
 }
82 77
 
83 78
 func (opts *workloadPolicyOpts) RunE(cmd *cobra.Command, args []string) error {
84
-	if len(opts.service) > 0 {
85
-		return errorServiceFlagDeprecated
86
-	}
87 79
 	if len(args) > 0 {
88 80
 		return errorWantedNoArgs
89 81
 	}

+ 0
- 9
cmd/fluxctl/release_cmd.go View File

@@ -31,8 +31,6 @@ type workloadReleaseOpts struct {
31 31
 	outputOpts
32 32
 	cause update.Cause
33 33
 
34
-	// Deprecated
35
-	services []string
36 34
 	// Deprecated
37 35
 	controllers []string
38 36
 }
@@ -67,9 +65,6 @@ func (opts *workloadReleaseOpts) Command() *cobra.Command {
67 65
 	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)")
68 66
 	cmd.Flags().BoolVarP(&opts.watch, "watch", "w", false, "Watch rollout progress during release")
69 67
 
70
-	// Deprecated
71
-	cmd.Flags().StringSliceVarP(&opts.services, "service", "s", []string{}, "Service to release")
72
-	cmd.Flags().MarkHidden("service")
73 68
 	// Deprecated
74 69
 	cmd.Flags().StringSliceVarP(&opts.controllers, "controller", "c", []string{}, "List of controllers to release <namespace>:<kind>/<name>")
75 70
 	cmd.Flags().MarkDeprecated("controller", "changed to --workspace, use that instead")
@@ -78,10 +73,6 @@ func (opts *workloadReleaseOpts) Command() *cobra.Command {
78 73
 }
79 74
 
80 75
 func (opts *workloadReleaseOpts) RunE(cmd *cobra.Command, args []string) error {
81
-	if len(opts.services) > 0 {
82
-		return errorServiceFlagDeprecated
83
-	}
84
-
85 76
 	if len(args) != 0 {
86 77
 		return errorWantedNoArgs
87 78
 	}

+ 0
- 1
cmd/fluxctl/root_cmd.go View File

@@ -78,7 +78,6 @@ func (opts *rootOpts) Command() *cobra.Command {
78 78
 
79 79
 	cmd.AddCommand(
80 80
 		newVersionCommand(),
81
-		newServiceList(opts).Command(),
82 81
 		newImageList(opts).Command(),
83 82
 		newWorkloadList(opts).Command(),
84 83
 		newWorkloadRelease(opts).Command(),

+ 0
- 9
cmd/fluxctl/unlock_cmd.go View File

@@ -13,8 +13,6 @@ type workloadUnlockOpts struct {
13 13
 	outputOpts
14 14
 	cause update.Cause
15 15
 
16
-	// Deprecated
17
-	service string
18 16
 	// Deprecated
19 17
 	controller string
20 18
 }
@@ -37,9 +35,6 @@ func (opts *workloadUnlockOpts) Command() *cobra.Command {
37 35
 	cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Controller namespace")
38 36
 	cmd.Flags().StringVarP(&opts.workload, "workload", "w", "", "Controller to unlock")
39 37
 
40
-	// Deprecated
41
-	cmd.Flags().StringVarP(&opts.service, "service", "s", "", "Service to unlock")
42
-	cmd.Flags().MarkHidden("service")
43 38
 	// Deprecated
44 39
 	cmd.Flags().StringVarP(&opts.controller, "controller", "c", "", "Controller to unlock")
45 40
 	cmd.Flags().MarkDeprecated("controller", "changed to --workload, use that instead")
@@ -48,10 +43,6 @@ func (opts *workloadUnlockOpts) Command() *cobra.Command {
48 43
 }
49 44
 
50 45
 func (opts *workloadUnlockOpts) RunE(cmd *cobra.Command, args []string) error {
51
-	if len(opts.service) > 0 {
52
-		return errorServiceFlagDeprecated
53
-	}
54
-
55 46
 	// Backwards compatibility with --controller until we remove it
56 47
 	switch {
57 48
 	case opts.workload != "" && opts.controller != "":

Loading…
Cancel
Save