Skip to content
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

Add OpenAPI scheme methods for metav1.Duration #69803

Merged

Conversation

rfranzke
Copy link
Contributor

What this PR does / why we need it: The metav1.Duration type does not have the OpenAPI methods. Using it in any resource type will fail the validation kubectl performs against the openapi specification:

# * : Invalid value: "The edited file failed validation": [ValidationError(Foo.spec.duration): invalid type for io.k8s.apimachinery    .pkg.apis.meta.v1.Duration: got "string", expected "map",

Similar to the metav1.Time methods this PR will add the same functionality to the metav1.Duration type.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 15, 2018
@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 15, 2018
@fedebongio
Copy link
Contributor

/assign @mbohlool

@rfranzke
Copy link
Contributor Author

/assign @sttts

@idealhack
Copy link
Member

/kind bug
/ok-to-test

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 18, 2018
@rfranzke
Copy link
Contributor Author

/retest

@inish777
Copy link

inish777 commented Dec 6, 2018

@rfranzke @mbohlool @stts @idealhack Absence of OpenAPI scheme methods for metav1.Duration also causing issues with generating OpenAPI code for CRDs using metav1 API.

apis/config/v1alpha1/openapi_generated.go:13098:31: v1.Duration literal.OpenAPISchemaType undefined (type v1.Duration has no field or method OpenAPISchemaType)
apis/config/v1alpha1/openapi_generated.go:13099:31: v1.Duration literal.OpenAPISchemaFormat undefined (type v1.Duration has no field or method OpenAPISchemaFormat)

To workaround this issue I use forked kubernetes/apimachinery with applied patch from this PR, but it's quite a dirty hack. What should we do to merge this PR?

@idealhack
Copy link
Member

idealhack commented Dec 6, 2018

@inish777 We have to reach out to sig-api-machinery to find some reviewers.

@kubernetes/sig-api-machinery-pr-reviews

@liggitt
Copy link
Member

liggitt commented Dec 6, 2018

change OpenAPISchemaFormat to return "", lgtm otherwise

@rfranzke
Copy link
Contributor Author

rfranzke commented Dec 6, 2018

Agreed, thank you!
Done.

@k8s-ci-robot k8s-ci-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Dec 6, 2018
@liggitt
Copy link
Member

liggitt commented Dec 6, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 6, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, rfranzke

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2018
@rfranzke
Copy link
Contributor Author

rfranzke commented Dec 6, 2018

/test pull-kubernetes-integration

@rfranzke
Copy link
Contributor Author

rfranzke commented Dec 6, 2018

/test pull-kubernetes-e2e-kops-aws

1 similar comment
@idealhack
Copy link
Member

/test pull-kubernetes-e2e-kops-aws

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

2 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@inish777
Copy link

inish777 commented Dec 7, 2018

@idealhack @rfranzke @liggitt thank you!

@k8s-ci-robot k8s-ci-robot merged commit 2ea5000 into kubernetes:master Dec 7, 2018
@rfranzke rfranzke deleted the fix/metav1_duration_openapi branch February 26, 2019 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants