Skip to content

Commit

Permalink
refractor: remove unused labels variable from generateFualtWeights()
Browse files Browse the repository at this point in the history
Signed-off-by: SohamRatnaparkhi <[email protected]>
  • Loading branch information
SohamRatnaparkhi committed Jun 30, 2023
1 parent 86983a6 commit 97ea86a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions litmus-portal/graphql-server/pkg/chaos-workflow/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func updateManifestLabels(labels map[string]string, workflowID string, clusterID
return labels
}

func generateFaultWeights(templates []v1alpha1.Template, labels map[string]string, weights map[string]int) ([]v1alpha1.Template, []*model.WeightagesInput, error) {
func generateFaultWeights(templates []v1alpha1.Template, weights map[string]int) ([]v1alpha1.Template, []*model.WeightagesInput, error) {
var newWeights []*model.WeightagesInput

for i, template := range templates {
Expand Down Expand Up @@ -415,7 +415,7 @@ func processWorkflowManifest(workflow *model.ChaosWorkFlowRequest, weights map[s

workflowManifest.Labels = updateManifestLabels(workflowManifest.Labels, *workflow.WorkflowID, workflow.ClusterID, false)

workflowManifest.Spec.Templates, newWeights, err = generateFaultWeights(workflowManifest.Spec.Templates, workflowManifest.Labels, weights)
workflowManifest.Spec.Templates, newWeights, err = generateFaultWeights(workflowManifest.Spec.Templates, weights)
if err != nil {
return err
}
Expand Down Expand Up @@ -455,7 +455,7 @@ func processCronWorkflowManifest(workflow *model.ChaosWorkFlowRequest, weights m
cronWorkflowManifest.Spec.WorkflowMetadata.Labels = updateManifestLabels(cronWorkflowManifest.Spec.WorkflowMetadata.Labels, *workflow.WorkflowID, workflow.ClusterID, false)
}

cronWorkflowManifest.Spec.WorkflowSpec.Templates, newWeights, err = generateFaultWeights(cronWorkflowManifest.Spec.WorkflowSpec.Templates, cronWorkflowManifest.Spec.WorkflowMetadata.Labels, weights)
cronWorkflowManifest.Spec.WorkflowSpec.Templates, newWeights, err = generateFaultWeights(cronWorkflowManifest.Spec.WorkflowSpec.Templates, weights)
if err != nil {
return err
}
Expand Down

0 comments on commit 97ea86a

Please sign in to comment.