Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/controller/coinbase_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func (r *CoinbaseReconciler) updateDeployment(dep *appsv1.Deployment, coinbase *
return err
}
dep.Spec = *defaultCoinbaseDeploymentSpec()
utils.SetDeploymentOverrides(r.Client, dep, coinbase)
utils.SetClusterOverrides(r.Client, dep, coinbase)
utils.SetDeploymentOverrides(r.Client, dep, coinbase)

return nil
}
Expand Down
6 changes: 3 additions & 3 deletions internal/utils/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
SetDeploymentOverridesWithContext(context.Background(), logr.Logger{}, client, dep, cr, "")
}

func SetDeploymentOverridesWithContext(ctx context.Context, log logr.Logger, client client.Client, dep *appsv1.Deployment, cr v1alpha1.TeranodeService, crKind string) {

Check failure on line 37 in internal/utils/deployment.go

View workflow job for this annotation

GitHub Actions / 📊 Code Quality / ✨ Lint Code

cognitive complexity 20 of func `SetDeploymentOverridesWithContext` is high (> 10) (gocognit)
if cr.DeploymentOverrides() == nil {
return
}
Expand Down Expand Up @@ -116,13 +116,13 @@
}
if len(cr.DeploymentOverrides().VolumeMounts) > 0 {
dep.Spec.Template.Spec.Containers[0].VolumeMounts = append(dep.Spec.Template.Spec.Containers[0].VolumeMounts, cr.DeploymentOverrides().VolumeMounts...)
if cr.DeploymentOverrides().Replicas != nil {
dep.Spec.Replicas = cr.DeploymentOverrides().Replicas
}
}
if cr.DeploymentOverrides().Replicas != nil {
dep.Spec.Replicas = cr.DeploymentOverrides().Replicas
}
}

func SetClusterOverrides(client client.Client, dep *appsv1.Deployment, cr v1alpha1.TeranodeService) {

Check failure on line 125 in internal/utils/deployment.go

View workflow job for this annotation

GitHub Actions / 📊 Code Quality / ✨ Lint Code

cognitive complexity 29 of func `SetClusterOverrides` is high (> 10) (gocognit)
// if parent cluster CR has a configmap or env vars set, append it first
clusterOwner := GetClusterOwner(client, context.Background(), cr.Metadata())
if clusterOwner == nil {
Expand Down
Loading