Skip to content

Commit

Permalink
Use constants for switch cases
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisFrench committed Mar 22, 2022
1 parent 99acbe9 commit 908cfd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controllers/app_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 908cfd5

Please sign in to comment.