Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishnaviHire committed Jun 18, 2024
1 parent 889a9a8 commit b502136
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 0 additions & 1 deletion components/kserve/kserve_config_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"


"github.com/hashicorp/go-multierror"
operatorv1 "github.com/openshift/api/operator/v1"
corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion components/workbenches/workbenches.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (w *Workbenches) ReconcileComponent(ctx context.Context, cli client.Client,
}
}
}
if err = deploy.DeployManifestsFromPath(cli, owner,
if err := deploy.DeployManifestsFromPath(cli, owner,
kfnotebookControllerPath,
dscispec.ApplicationsNamespace,
ComponentName, enabled); err != nil {
Expand Down
1 change: 0 additions & 1 deletion controllers/dscinitialization/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
routev1 "github.com/openshift/api/route/v1"
userv1 "github.com/openshift/api/user/v1"
ofapi "github.com/operator-framework/api/pkg/operators/v1alpha1"

ofapiv2 "github.com/operator-framework/api/pkg/operators/v2"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down
13 changes: 13 additions & 0 deletions pkg/cluster/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,16 @@ func WaitForDeploymentAvailable(ctx context.Context, c client.Client, componentN
return true, nil
})
}

func CreateWithRetry(ctx context.Context, cli client.Client, obj client.Object, timeoutMin int) error {
interval := time.Second * 5 // arbitrary value
timeout := time.Duration(timeoutMin) * time.Minute

return wait.PollUntilContextTimeout(ctx, interval, timeout, true, func(ctx context.Context) (bool, error) {
err := cli.Create(ctx, obj)
if err != nil {
return false, nil //nolint:nilerr
}
return true, nil
})
}

0 comments on commit b502136

Please sign in to comment.