Skip to content

Commit ac2c450

Browse files
committed
Update with stdlib errors
1 parent 6834a1e commit ac2c450

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ limitations under the License.
1717
package cel
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"strings"
2223
"time"
2324

2425
"github.com/google/cel-go/cel"
2526
"github.com/google/cel-go/checker"
2627
"github.com/google/cel-go/common/types"
27-
"github.com/pkg/errors"
2828

2929
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
3030
"k8s.io/apiextensions-apiserver/pkg/apiserver/schema"
@@ -127,7 +127,7 @@ func Compile(s *schema.Structural, declType *apiservercel.DeclType, perCallLimit
127127
return nil, nil
128128
}
129129
if declType == nil {
130-
return nil, errors.New("Failed to convert to declType for CEL validation rules")
130+
return nil, errors.New("failed to convert to declType for CEL validation rules")
131131
}
132132
celRules := s.XValidations
133133

test/integration/apiserver/crd_validation_expressions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ func TestCustomResourceValidatorsWithSchemaConversion(t *testing.T) {
718718
}
719719
oldCR.Object["metadata"].(map[string]interface{})["labels"] = map[string]interface{}{"key": "value"}
720720
_, err = crClient.Update(context.TODO(), oldCR, metav1.UpdateOptions{})
721-
if err == nil || !strings.Contains(err.Error(), "rule compiler initialization error: Failed to convert to declType for CEL validation rules") {
722-
t.Fatalf("expect error to contain \rule compiler initialization error: Failed to convert to declType for CEL validation rules\" but get: %v", err)
721+
if err == nil || !strings.Contains(err.Error(), "rule compiler initialization error: failed to convert to declType for CEL validation rules") {
722+
t.Fatalf("expect error to contain \rule compiler initialization error: failed to convert to declType for CEL validation rules\" but get: %v", err)
723723
}
724724
// Create another CR instance with an array and be rejected
725725
name2 := names.SimpleNameGenerator.GenerateName("cr-2")

0 commit comments

Comments
 (0)