-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting resource_version on ClusterRole to string throws error: error: strconv.ParseUint: parsing "example-clusterrole": invalid syntax
#2351
Comments
Hey @rshade ! Looking at this issue, it appears the API spec for K8s requires this to be a |
@kpitzen Yeah, its definitely some unfortunate kube behavior. I think if we throw the error during parsing, it should be fine, instead of when the kube client does it. Its very difficult from that error to discern where the problem is. |
The
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta |
Related to the read-only aspect, bear in mind that the resource version is the basis for optimistic concurrency, and an update or patch request may specify it. |
strconv.ParseUint: parsing "examle-clusterrole": invalid syntax
strconv.ParseUint: parsing "example-clusterrole": invalid syntax
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes <!--Give us a brief description of what you've done and what it solves. --> This PR improves the handling of the read-only metadata fields of Kubernetes objects, such as `creationTimestamp` and `resourceVersion`. The provider now ignores these fields when they appear as resource inputs, to address a few quirks: 1. Unparseable values do not cause an API Server error during preview. 2. A subsequent refresh does not show a difference to the `__inputs` property. 3. The behavior is now uniform for standard resource types and for custom resource types. An integration test is provided to show that such fields are ignored as inputs, and are still available as outputs. Manual tests confirmed identical behavior for custom resource objects. ### Related issues (optional) Closes #2351 Related: - #2511 - #2445 <!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes #1234'. Or link to full URLs to issues or pull requests in other GitHub repositories. -->
What happened?
Setting resource_version on ClusterRole to string throws error: error:
strconv.ParseUint: parsing "examle-clusterrole": invalid syntax
. The type is set to str in https://github.com/pulumi/pulumi-kubernetes/blob/master/sdk/python/pulumi_kubernetes/meta/v1/_inputs.py#L1013Expected Behavior
Unsure, either it should type check early or possibly a better error message.
Steps to reproduce
Output of
pulumi about
kubernetes 3.24.2
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: