Skip to content

Commit

Permalink
Fix lint issues.
Browse files Browse the repository at this point in the history
Signed-off-by: Wang, Wayne <[email protected]>
  • Loading branch information
wang-wayne committed Aug 30, 2024
1 parent 0446f62 commit 70c5e90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/argo/commands/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ spec:
defer func() { logrus.StandardLogger().ExitFunc = nil }()
var fatal bool
logrus.StandardLogger().ExitFunc = func(int) { fatal = true }
runLint(context.Background(), []string{workflowMultiDocsPath}, true, nil, "pretty", false)
runLint(context.Background(), []string{workflowMultiDocsPath}, true, nil, "pretty", false)

assert.False(t, fatal, "should not have exited")
})
Expand Down
16 changes: 8 additions & 8 deletions pkg/apiclient/offline-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ func newOfflineClient(paths []string) (context.Context, Client, error) {
if obj == nil {
continue // could not parse to kubernetes object
}

objName := obj.GetName()
namespace := obj.GetNamespace()
switch v:= obj.(type) {
case *wfv1.ClusterWorkflowTemplate:

switch v := obj.(type) {
case *wfv1.ClusterWorkflowTemplate:
if _, ok := clusterWorkflowTemplateGetter.clusterWorkflowTemplates[objName]; ok {
return fmt.Errorf("duplicate ClusterWorkflowTemplate found: %q", objName)
}
clusterWorkflowTemplateGetter.clusterWorkflowTemplates[objName] = v

case *wfv1.WorkflowTemplate:
getter, ok := workflowTemplateGetters[namespace]
if !ok {
Expand All @@ -78,14 +78,14 @@ func newOfflineClient(paths []string) (context.Context, Client, error) {
}
workflowTemplateGetters[namespace] = getter
}

if _, ok := getter.(*offlineWorkflowTemplateNamespacedGetter).workflowTemplates[objName]; ok {
return fmt.Errorf("duplicate WorkflowTemplate found: %q", objName)
}
getter.(*offlineWorkflowTemplateNamespacedGetter).workflowTemplates[objName] = v
getter.(*offlineWorkflowTemplateNamespacedGetter).workflowTemplates[objName] = v
}

}
}
return nil
})

Expand Down

0 comments on commit 70c5e90

Please sign in to comment.