Skip to content

Commit 541ec26

Browse files
fix(trial): rename errors pkg.
Signed-off-by: Electronic-Waste <[email protected]>
1 parent 303938b commit 541ec26

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/controller.v1beta1/trial/trial_controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ package trial
1818

1919
import (
2020
"context"
21+
"errors"
2122
"fmt"
2223
"time"
2324

2425
"github.com/spf13/viper"
2526
corev1 "k8s.io/api/core/v1"
2627
"k8s.io/apimachinery/pkg/api/equality"
27-
"k8s.io/apimachinery/pkg/api/errors"
28+
apierrors "k8s.io/apimachinery/pkg/api/errors"
2829
"k8s.io/apimachinery/pkg/api/meta"
2930
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3031
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -153,7 +154,7 @@ func (r *ReconcileTrial) Reconcile(ctx context.Context, request reconcile.Reques
153154
original := &trialsv1beta1.Trial{}
154155
err := r.Get(ctx, request.NamespacedName, original)
155156
if err != nil {
156-
if errors.IsNotFound(err) {
157+
if apierrors.IsNotFound(err) {
157158
// Object not found, return. Created objects are automatically garbage collected.
158159
// For additional cleanup logic use finalizers.
159160
return reconcile.Result{}, nil
@@ -277,7 +278,7 @@ func (r *ReconcileTrial) reconcileJob(instance *trialsv1beta1.Trial, desiredJob
277278
deployedJob.SetGroupVersionKind(gvk)
278279
err = r.Get(context.TODO(), types.NamespacedName{Name: desiredJob.GetName(), Namespace: desiredJob.GetNamespace()}, deployedJob)
279280
if err != nil {
280-
if errors.IsNotFound(err) {
281+
if apierrors.IsNotFound(err) {
281282
if instance.IsCompleted() {
282283
return nil, nil
283284
}

0 commit comments

Comments
 (0)