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

fix: Corrects CRD and Swagger types. Fixes #3578 #3809

Merged
merged 16 commits into from
Aug 27, 2020

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Aug 18, 2020

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed the CLA.
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

Fixes #3578

// +protobuf.options.(gogoproto.goproto_stringer)=false
// +k8s:openapi-gen=true
// +kubebuilder:validation:Type=object
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is actually not fixable, because Item can be anything, but code-generator mandates a single type only, we must choose the best/least worst type.

@@ -338,8 +338,9 @@ func (s ShutdownStrategy) ShouldExecute(isOnExitPod bool) bool {
}
}

// +kubebuilder:validation:Type=array
Copy link
Contributor Author

Choose a reason for hiding this comment

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

kubebuilder is too limited to correctly describe this type. We must choose a best option.

@@ -379,7 +380,7 @@ func (p *ParallelSteps) UnmarshalJSON(value []byte) error {
return nil
}

func (p *ParallelSteps) MarshalJSON() ([]byte, error) {
func (p ParallelSteps) MarshalJSON() ([]byte, error) {
Copy link
Contributor Author

@alexec alexec Aug 18, 2020

Choose a reason for hiding this comment

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

MarshallJSON MUST not be a pointer receiver, otherwise we cannot marshal not-pointer instances of the type.

@alexec alexec marked this pull request as ready for review August 20, 2020 23:05
@alexec alexec requested a review from jessesuen as a code owner August 20, 2020 23:05
@alexec
Copy link
Contributor Author

alexec commented Aug 24, 2020

Need @jessesuen to approve proto changes.

@alexec alexec marked this pull request as draft August 24, 2020 18:59
@alexec alexec marked this pull request as ready for review August 24, 2020 21:24
@alexec
Copy link
Contributor Author

alexec commented Aug 24, 2020

Migrating to generator v0.4.0 (which would allow the any type) also involves moving to 0.18 - which changes many of the APIs.

@alexec alexec marked this pull request as draft August 25, 2020 17:43
@alexec
Copy link
Contributor Author

alexec commented Aug 25, 2020

@jessesuen tried out v0.4.0 and got it working, but looks like IntellI does not support Any :(

@alexec alexec marked this pull request as ready for review August 26, 2020 16:43
@alexec alexec merged commit 359ee8d into argoproj:master Aug 27, 2020
@alexec alexec deleted the fix-3578 branch August 27, 2020 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

withItems incorrect type in full CRD
2 participants