-
Notifications
You must be signed in to change notification settings - Fork 538
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
metav1.Duration doesn't parse d
, w
; conflicts with kubebuilder format=duration
validation
#131
Comments
Due to a difference in how apiserver validates `Format=duration` vs how apimachinery unmarshals `metav1.Duration`, using that format can allow users to blow up some of our controllers if they provide certain values for Duration fields (specifically: containing `d` or `w` units). Upstream issues have been opened against both sides of this discrepancy: - kubernetes/apimachinery#131 - kubernetes/apiextensions-apiserver#56 In the meantime, work around the problem by using an explicit regex instead of the built in format validator. Closes 2050332
Due to a difference in how apiserver validates `Format=duration` vs how apimachinery unmarshals `metav1.Duration`, using that format can allow users to blow up some of our controllers if they provide certain values for Duration fields (specifically: containing `d` or `w` units). Upstream issues have been opened against both sides of this discrepancy: - kubernetes/apimachinery#131 - kubernetes/apiextensions-apiserver#56 In the meantime, work around the problem by using an explicit regex instead of the built in format validator. (cherry picked from commit 665b268) Conflicts: apis/hive/v1/clusterpool_types.go config/crds/hive.openshift.io_clusterpools.yaml hack/app-sre/saas-template.yaml vendor/github.com/openshift/hive/apis/hive/v1/clusterpool_types.go These were due to the ResumeTimeout field added to ClusterPool since 2.4. HIVE-1760
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
To solve disrepancies between parsing versus validation. xref: kubernetes/apimachinery#131 Signed-off-by: Hidde Beydals <[email protected]>
To solve discrepancies between parsing versus validation. xref: kubernetes/apimachinery#131 Signed-off-by: Hidde Beydals <[email protected]>
To solve discrepancies between parsing versus validation. xref: kubernetes/apimachinery#131 Signed-off-by: Hidde Beydals <[email protected]>
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-lifecycle rotten |
Despite validation of type=duration being documented as parsed by time.ParseDuration, which is what the unmarshaller does, it is actually parsed by strfmt.ParseDuration, which is more lenient in that it accepts
d
(days) andw
(weeks).The result is that the round trip is broken: go type => CRD => CR with
d
orw
=> apiserver validation (acceptsd
/w
) => etcd => GET => unmarshal (blows up ond
/w
) => go type.Example of such a CRD struct field definition.
And a BZ that uncovered the problem.
cf. kubernetes/apiextensions-apiserver#56
Possible solutions:
The text was updated successfully, but these errors were encountered: