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

crd: Add validation using OpenAPI 3.0 #605

Merged
merged 2 commits into from
May 25, 2018
Merged

crd: Add validation using OpenAPI 3.0 #605

merged 2 commits into from
May 25, 2018

Conversation

gaocegege
Copy link
Member

@gaocegege gaocegege commented May 25, 2018

/assign @jlewi @ScorpioCPH

The feature is restricted and I only add validation for replicas. This avoids the crash problem when replicas < 0.

related to: #437

Signed-off-by: Ce Gao [email protected]


This change is Reviewable

@gaocegege
Copy link
Member Author

/retest

@gaocegege
Copy link
Member Author

If we could find the validation for pod template spec, then we could reuse it here. While I do not find it.

@gaocegege
Copy link
Member Author

/retest

2 similar comments
@gaocegege
Copy link
Member Author

/retest

@gaocegege
Copy link
Member Author

/retest

@jlewi
Copy link
Contributor

jlewi commented May 25, 2018

I think the test failures could be kubeflow/kubeflow#869

Worker:
properties:
replicas:
type: integer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the minimum 1? Shouldn't the minimum be 0 for Worker & PS since they aren't required?
Even chief should have minimum 0 because in some cases we will have N workers and the first worker will be the chief and there will be no explict chief.

Copy link
Member Author

@gaocegege gaocegege May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no worker or PS, the check will not be executed. Thus this is for the case that we have the worker/ps/chief definition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment to that effect?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Can we put a comment to that effect?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will do it.

@@ -9,3 +9,26 @@ spec:
kind: TFJob
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intented to get ack for the current changes and use tools to convert YAML to json. Then I will put the code to the ksonnet package. Sorry for that 😄

@gaocegege
Copy link
Member Author

/assign @jlewi

@jlewi
Copy link
Contributor

jlewi commented May 25, 2018

/hold
Do you still want to submit this in addition to the ksonnet changes? If so then just cancel the hold.

/lgtm
/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlewi

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

@gaocegege
Copy link
Member Author

/hold cancel

I will file a new PR if I find a way to check the podtemplatespec

@k8s-ci-robot k8s-ci-robot merged commit e8e152e into kubeflow:master May 25, 2018
@gaocegege gaocegege deleted the validation branch May 25, 2018 13:52
@coveralls
Copy link

coveralls commented May 25, 2018

Coverage Status

Coverage remained the same at 55.646% when pulling 1175791 on gaocegege:validation into 98b777e on kubeflow:master.

yph152 pushed a commit to yph152/tf-operator that referenced this pull request Jun 18, 2018
* crd: Add validation using OpenAPI 3.0

Signed-off-by: Ce Gao <[email protected]>

* crd-v1alpha2: Add comment

Signed-off-by: Ce Gao <[email protected]>
jetmuffin pushed a commit to jetmuffin/tf-operator that referenced this pull request Jul 9, 2018
* crd: Add validation using OpenAPI 3.0

Signed-off-by: Ce Gao <[email protected]>

* crd-v1alpha2: Add comment

Signed-off-by: Ce Gao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants