From f5d3283cff38e64ee1d71df37dda1daf188e6707 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Fri, 13 Oct 2023 10:48:08 +0200 Subject: [PATCH] misc: remove unused bits of code Signed-off-by: Hidde Beydals --- cmd/flux/create_image_policy.go | 14 ++++++-------- cmd/flux/export_secret.go | 1 - cmd/flux/main_test.go | 2 -- cmd/flux/reconcile_image_updateauto.go | 4 ---- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/cmd/flux/create_image_policy.go b/cmd/flux/create_image_policy.go index 116a2152..db287ed2 100644 --- a/cmd/flux/create_image_policy.go +++ b/cmd/flux/create_image_policy.go @@ -54,13 +54,12 @@ the status of the object.`), RunE: createImagePolicyRun} type imagePolicyFlags struct { - imageRef string - semver string - alpha string - numeric string - filterRegex string - filterExtract string - filterNumerical string + imageRef string + semver string + alpha string + numeric string + filterRegex string + filterExtract string } var imagePolicyArgs = imagePolicyFlags{} @@ -183,7 +182,6 @@ func validateExtractStr(template string, capNames []string) error { name, num, rest, ok := extract(template) if !ok { // Malformed extract string, assume user didn't want this - template = template[1:] return fmt.Errorf("--filter-extract is malformed") } template = rest diff --git a/cmd/flux/export_secret.go b/cmd/flux/export_secret.go index 4a87e233..76d6ec56 100644 --- a/cmd/flux/export_secret.go +++ b/cmd/flux/export_secret.go @@ -46,7 +46,6 @@ type exportableWithSecretList interface { } type exportWithSecretCommand struct { - apiType object exportableWithSecret list exportableWithSecretList } diff --git a/cmd/flux/main_test.go b/cmd/flux/main_test.go index cdddf054..b97397ff 100644 --- a/cmd/flux/main_test.go +++ b/cmd/flux/main_test.go @@ -340,8 +340,6 @@ type cmdTestCase struct { // Tests use assertFunc to assert on an output, success or failure. This // can be a function defined by the test or existing function above. assert assertFunc - // Filename that contains yaml objects to load into Kubernetes - objectFile string } func (cmd *cmdTestCase) runTestCmd(t *testing.T) { diff --git a/cmd/flux/reconcile_image_updateauto.go b/cmd/flux/reconcile_image_updateauto.go index 8fba13cc..2db4a1c0 100644 --- a/cmd/flux/reconcile_image_updateauto.go +++ b/cmd/flux/reconcile_image_updateauto.go @@ -43,10 +43,6 @@ func init() { reconcileImageCmd.AddCommand(reconcileImageUpdateCmd) } -func (obj imageUpdateAutomationAdapter) suspended() bool { - return obj.ImageUpdateAutomation.Spec.Suspend -} - func (obj imageUpdateAutomationAdapter) lastHandledReconcileRequest() string { return obj.Status.GetLastHandledReconcileRequest() }