Skip to content

Commit 8f2def1

Browse files
committed
Adjust to changes in CEL compilation error output
1 parent 628f443 commit 8f2def1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/controllers/clusterclass/clusterclass_controller_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,15 +1101,15 @@ func TestReconciler_reconcileVariables(t *testing.T) {
11011101
wantErrMessage: "failed to discover variables for ClusterClass class1: [" +
11021102
"patch1.variables[cpu].schema.openAPIV3Schema.properties[nestedField].default: Invalid value: \"integer\": failed rule: self >= 1, " +
11031103
"patch1.variables[anotherCPU].schema.openAPIV3Schema.x-kubernetes-validations[0].messageExpression: Invalid value: " +
1104-
"apiextensions.ValidationRule{Rule:\"self >= 1\", Message:\"\", MessageExpression:\"'Expected integer greater or equal to 1, got ' + this does not compile\", " +
1105-
"Reason:(*apiextensions.FieldValueErrorReason)(nil), FieldPath:\"\", OptionalOldSelf:(*bool)(nil)}: " +
1104+
"{\"Rule\":\"self \\u003e= 1\",\"Message\":\"\",\"MessageExpression\":\"'Expected integer greater or equal to 1, got ' + this does not compile\"," +
1105+
"\"Reason\":null,\"FieldPath\":\"\",\"OptionalOldSelf\":null}: " +
11061106
"messageExpression compilation failed: ERROR: <input>:1:55: Syntax error: mismatched input 'does' expecting <EOF>\n " +
11071107
"| 'Expected integer greater or equal to 1, got ' + this does not compile\n " +
11081108
"| ......................................................^]",
11091109
wantVariableDiscoveryErrorMessage: "VariableDiscovery failed: [patch1.variables[cpu].schema.openAPIV3Schema.properties[nestedField].default: Invalid value: \"integer\": failed rule: self >= 1, " +
11101110
"patch1.variables[anotherCPU].schema.openAPIV3Schema.x-kubernetes-validations[0].messageExpression: Invalid value: " +
1111-
"apiextensions.ValidationRule{Rule:\"self >= 1\", Message:\"\", MessageExpression:\"'Expected integer greater or equal to 1, got ' + this does not compile\", " +
1112-
"Reason:(*apiextensions.FieldValueErrorReason)(nil), FieldPath:\"\", OptionalOldSelf:(*bool)(nil)}: " +
1111+
"{\"Rule\":\"self \\u003e= 1\",\"Message\":\"\",\"MessageExpression\":\"'Expected integer greater or equal to 1, got ' + this does not compile\"," +
1112+
"\"Reason\":null,\"FieldPath\":\"\",\"OptionalOldSelf\":null}: " +
11131113
"messageExpression compilation failed: ERROR: <input>:1:55: Syntax error: mismatched input 'does' expecting <EOF>\n " +
11141114
"| 'Expected integer greater or equal to 1, got ' + this does not compile\n " +
11151115
"| ......................................................^]",
@@ -1150,15 +1150,15 @@ func TestReconciler_reconcileVariables(t *testing.T) {
11501150
},
11511151
wantErrMessage: "failed to discover variables for ClusterClass class1: " +
11521152
"patch1.variables[someIP].schema.openAPIV3Schema.x-kubernetes-validations[0].rule: Invalid value: " +
1153-
"apiextensions.ValidationRule{Rule:\"ip(self).family() == 6\", Message:\"\", MessageExpression:\"\", Reason:(*apiextensions.FieldValueErrorReason)(nil), FieldPath:\"\", OptionalOldSelf:(*bool)(nil)}: compilation failed: " +
1153+
"{\"Rule\":\"ip(self).family() == 6\",\"Message\":\"\",\"MessageExpression\":\"\",\"Reason\":null,\"FieldPath\":\"\",\"OptionalOldSelf\":null}: compilation failed: " +
11541154
"ERROR: <input>:1:3: undeclared reference to 'ip' (in container '')\n" +
11551155
" | ip(self).family() == 6\n" +
11561156
" | ..^\n" +
11571157
"ERROR: <input>:1:16: undeclared reference to 'family' (in container '')\n" +
11581158
" | ip(self).family() == 6\n" +
11591159
" | ...............^",
11601160
wantVariableDiscoveryErrorMessage: "VariableDiscovery failed: patch1.variables[someIP].schema.openAPIV3Schema.x-kubernetes-validations[0].rule: Invalid value: " +
1161-
"apiextensions.ValidationRule{Rule:\"ip(self).family() == 6\", Message:\"\", MessageExpression:\"\", Reason:(*apiextensions.FieldValueErrorReason)(nil), FieldPath:\"\", OptionalOldSelf:(*bool)(nil)}: compilation failed: " +
1161+
"{\"Rule\":\"ip(self).family() == 6\",\"Message\":\"\",\"MessageExpression\":\"\",\"Reason\":null,\"FieldPath\":\"\",\"OptionalOldSelf\":null}: compilation failed: " +
11621162
"ERROR: <input>:1:3: undeclared reference to 'ip' (in container '')\n" +
11631163
" | ip(self).family() == 6\n" +
11641164
" | ..^\n" +

0 commit comments

Comments
 (0)