Skip to content

Commit

Permalink
kserve: get rid of extra enabled check for setupKserveConfig()
Browse files Browse the repository at this point in the history
To avoid linter report:

components/kserve/kserve.go:97:1: cyclomatic complexity 31 of func `(*Kserve).ReconcileComponent` is high (> 30) (gocyclo)

move setupKserveConfig() call under "if enabled" branch below.

Signed-off-by: Yauheni Kaliuta <[email protected]>
  • Loading branch information
ykaliuta committed May 23, 2024
1 parent 4f2519e commit 2fbf8ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/kserve/kserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ func (k *Kserve) ReconcileComponent(ctx context.Context, cli client.Client,
return fmt.Errorf("failed to apply manifests from %s : %w", Path, err)
}

l.WithValues("Path", Path).Info("apply manifests done for kserve")

if enabled {
if err := k.setupKserveConfig(ctx, cli, dscispec); err != nil {
return err
}
}
l.WithValues("Path", Path).Info("apply manifests done for kserve")
// For odh-model-controller
if enabled {

// For odh-model-controller
if err := cluster.UpdatePodSecurityRolebinding(cli, dscispec.ApplicationsNamespace, "odh-model-controller"); err != nil {
return err
}
Expand Down

0 comments on commit 2fbf8ba

Please sign in to comment.