From 908cfd5f178dcfb998db67e00b9b07429171c0e9 Mon Sep 17 00:00:00 2001 From: DavisFrench Date: Tue, 22 Mar 2022 11:00:27 -0400 Subject: [PATCH] Use constants for switch cases --- internal/controllers/app_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controllers/app_controller.go b/internal/controllers/app_controller.go index 06721395..936c74fc 100644 --- a/internal/controllers/app_controller.go +++ b/internal/controllers/app_controller.go @@ -252,7 +252,7 @@ type workloadClient struct { // Get populates workload values based on the workloadType and returns the populated struct func (cli workloadClient) Get(ctx context.Context) (*workload, error) { switch cli.workloadType { - case "Deployment": + case ketchv1.DeploymentAppType: o, err := cli.k8sClient.AppsV1().Deployments(cli.workloadNamespace).Get(ctx, cli.workloadName, metav1.GetOptions{}) if err != nil { return nil, err @@ -271,7 +271,7 @@ func (cli workloadClient) Get(ctx context.Context) (*workload, error) { w.Conditions = append(w.Conditions, condition{Type: string(c.Type), Reason: c.Reason}) } return &w, nil - case "StatefulSet": + case ketchv1.StatefulSetAppType: o, err := cli.k8sClient.AppsV1().StatefulSets(cli.workloadNamespace).Get(ctx, cli.workloadName, metav1.GetOptions{}) if err != nil { return nil, err