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
We're using controller-gen generation in the aws/karpenter-provider-aws project, but we see that a pattern that we are using in our CRD is not validated when the key is of type IntOrString and the value that is passed-through is an integer. It doesn't seem to actually get validated until we attempt to update the resource later after the resource has already been applied to the apiserver. This causes resources to get stuck because they don't adhere to the "pattern" that is specified in the validation section, but the initial create is not rejected.
For example, I created a small repo that exemplifies this. When i install the test resource, and then apply the examples, I see the expected behavior when the inputs are strings; however, once the input becomes an integer, it passes right by the pattern validation.
# Install the CRDs from the repository
make install
# Apply a valid Test resource
kubectl apply -f config/samples/test_v1_valid_str.yaml
# Apply an invalid Test resource, see it fails
kubectl apply -f config/samples/test_v1_invalid_str.yaml
# Apply an invalid Test resource that doesn't adhere to the pattern but specifies an integer, see it passes when it shouldn't
kubectl apply -f config/samples/test_v1_valid_int.yaml
The text was updated successfully, but these errors were encountered:
We're using
controller-gen
generation in theaws/karpenter-provider-aws
project, but we see that a pattern that we are using in our CRD is not validated when the key is of typeIntOrString
and the value that is passed-through is an integer. It doesn't seem to actually get validated until we attempt to update the resource later after the resource has already been applied to the apiserver. This causes resources to get stuck because they don't adhere to the "pattern" that is specified in the validation section, but the initial create is not rejected.For example, I created a small repo that exemplifies this. When i install the test resource, and then apply the examples, I see the expected behavior when the inputs are strings; however, once the input becomes an integer, it passes right by the pattern validation.
The text was updated successfully, but these errors were encountered: