Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
lint fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Umare <[email protected]>
  • Loading branch information
kumare3 committed Sep 22, 2023
1 parent 4ae657a commit 44d1ba6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions pkg/manager/impl/execution_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,7 @@ func (m *ExecutionManager) launchSingleTaskExecution(
if err != nil {
return nil, nil, err
}
labels, err = m.addBaseExecutionLabel(ctx, workflowExecutionID.Name, labels)
if err != nil {
return nil, nil, err
}
labels = m.addBaseExecutionLabel(ctx, workflowExecutionID.Name, labels)

var annotations map[string]string
if executionConfig.Annotations != nil {
Expand Down Expand Up @@ -814,10 +811,8 @@ func (m *ExecutionManager) launchExecutionAndPrepareModel(
if err != nil {
return nil, nil, err
}
labels, err = m.addBaseExecutionLabel(ctx, workflowExecutionID.Name, labels)
if err != nil {
return nil, nil, err
}
labels = m.addBaseExecutionLabel(ctx, workflowExecutionID.Name, labels)

annotations, err := resolveStringMap(executionConfig.GetAnnotations(), launchPlan.Spec.Annotations, "annotations", m.config.RegistrationValidationConfiguration().GetMaxAnnotationEntries())
if err != nil {
return nil, nil, err
Expand Down Expand Up @@ -1698,14 +1693,14 @@ func (m *ExecutionManager) addProjectLabels(ctx context.Context, projectName str
// Adds base execution label to execution labels. Base execution label is ignored if a corresponding label is set on the execution already.
// An execution label will exist if Flytepropeller launches a child workflow execution, as it will copy the parent execution's labels.
// This label can later be used to retrieve all executions that were launched from a given execution, no matter how deep in the recursion tree.
func (m *ExecutionManager) addBaseExecutionLabel(_ context.Context, execID string, initialLabels map[string]string) (map[string]string, error) {
func (m *ExecutionManager) addBaseExecutionLabel(_ context.Context, execID string, initialLabels map[string]string) map[string]string {
if initialLabels == nil {
initialLabels = make(map[string]string)
}

Check warning on line 1699 in pkg/manager/impl/execution_manager.go

View check run for this annotation

Codecov / codecov/patch

pkg/manager/impl/execution_manager.go#L1698-L1699

Added lines #L1698 - L1699 were not covered by tests
if _, ok := initialLabels[shared.BaseExecutionIDLabelKey]; !ok {
initialLabels[shared.BaseExecutionIDLabelKey] = execID
}
return initialLabels, nil
return initialLabels
}

func addStateFilter(filters []common.InlineFilter) ([]common.InlineFilter, error) {
Expand Down

0 comments on commit 44d1ba6

Please sign in to comment.