You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, types in this repo do not have fieldPath set in their kubebuilder code markers. This can greatly improve readability of response body when invalid object is provided, e.g.
The KongCustomEntity "degraphql-route-example" is invalid:
* <nil>: Invalid value: "object": The spec.type field is immutable
* spec: Invalid value: "object": The type field cannot be one of the known Kong entity types
vs setting the fieldPath
The KongCustomEntity "degraphql-route-example" is invalid:
* spec.type: Invalid value: "object": The spec.type field is immutable
* spec.type: Invalid value: "object": The type field cannot be one of the known Kong entity types
Proposed solution
Set fieldPath for all relevant validation rules, example
diff --git a/api/configuration/v1alpha1/kong_custom_entity_types.go b/api/configuration/v1alpha1/kong_custom_entity_types.go
index 87e6c99..7176abe 100644
--- a/api/configuration/v1alpha1/kong_custom_entity_types.go+++ b/api/configuration/v1alpha1/kong_custom_entity_types.go@@ -23,7 +23,7 @@ type KongEntityScope string
// +kubebuilder:printcolumn:name="Entity Type",type=string,JSONPath=`.spec.type`,description="type of the Kong entity"
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age"
// +kubebuilder:printcolumn:name="Programmed",type=string,JSONPath=`.status.conditions[?(@.type=="Programmed")].status`
-// +kubebuilder:validation:XValidation:rule="self.spec.type == oldSelf.spec.type",message="The spec.type field is immutable"+// +kubebuilder:validation:XValidation:rule="self.spec.type == oldSelf.spec.type",message="The spec.type field is immutable",fieldPath=".spec.type"
// +apireference:kic:include
// +kong:channels=ingress-controller
type KongCustomEntity struct {
The text was updated successfully, but these errors were encountered:
Problem statement
Currently, types in this repo do not have
fieldPath
set in theirkubebuilder
code markers. This can greatly improve readability of response body when invalid object is provided, e.g.vs setting the
fieldPath
Proposed solution
Set
fieldPath
for all relevant validation rules, exampleThe text was updated successfully, but these errors were encountered: