Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Fix openapi generate rule violation #172

Merged
merged 1 commit into from
Nov 6, 2021

Conversation

pugangxa
Copy link
Contributor

@pugangxa pugangxa commented Nov 6, 2021

As mentioned in kubeflow/mpi-operator#434 (comment)

openapi-gen --input-dirs github.com/kubeflow/mpi-operator/v2/pkg/apis/kubeflow/v2beta1,github.com/kubeflow/common/pkg/apis/common/v1 --output-package github.com/kubeflow/mpi-operator/v2/pkg/apis/kubeflow/v2beta1 --go-header-file hack/boilerplate/boilerplate.go.txt
API rule violation: list_type_missing,github.com/kubeflow/common/pkg/apis/common/v1,JobStatus,Conditions

This PR fix this issue.

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: terrytangyuan

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

@google-oss-robot google-oss-robot merged commit a1f26a9 into kubeflow:master Nov 6, 2021
@@ -22,6 +22,7 @@ import (
// +k8s:deepcopy-gen=true
// JobStatus represents the current observed state of the training Job.
type JobStatus struct {
// +listType=set
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be a map, with listMapKey=type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm. afraid there can be conflicts if it's map with listMapKey=type. For example, there can be multiple items with the same JobCondition like Running. I think there can't be duplicated items so maybe set is suitable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why would there be multiple conditions for the same type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Condition is a list and it's open to user to set so it may happen though it's not recommended. But you are right I checked code for JobStatus it's impossible this way. I can modify it then.

Copy link
Contributor

Choose a reason for hiding this comment

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

The JobStatus is actually not up to the user, it's entirely controlled by the operators. And if our operators put the same condition more than once, it would be a bug. But generally, lists could act as maps if we decide to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, send another PR #174 to address this.

google-oss-prow bot pushed a commit that referenced this pull request Nov 11, 2021
…o not be empty (#174)

* Change listType to be map for jobstatus condition

* rollback the changes to allow empty value for condition
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants