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(controller)!: Support nested items. Fixes #3288 #3290

Merged
merged 5 commits into from Jun 29, 2020

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Jun 24, 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 #3288

This uses the same pattern now used in Argo Events:

@alexec alexec requested a review from sarabala1979 June 24, 2020 22:12
@alexec
Copy link
Contributor Author

alexec commented Jun 24, 2020

@sarabala1979 I've gutted Item replacing all the fields with a single Value json.RawMessage field that supports all formats.

@alexec alexec marked this pull request as ready for review June 24, 2020 22:15
@alexec alexec requested a review from jessesuen as a code owner June 24, 2020 22:15
StrVal string `protobuf:"bytes,4,opt,name=strVal"`
MapVal map[string]ItemValue `protobuf:"bytes,5,opt,name=mapVal"`
ListVal []ItemValue `protobuf:"bytes,6,opt,name=listVal"`
Value json.RawMessage `json:"value" protobuf:"bytes,1,opt,name=value,casttype=encoding/json.RawMessage"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change to []byte

@alexec
Copy link
Contributor Author

alexec commented Jun 25, 2020

@alexmt this PR removes item.go and uses a more flexible and simpler solution and you might want to take back to Argo CD.

@alexec alexec added this to the v2.10 milestone Jun 25, 2020
@alexec
Copy link
Contributor Author

alexec commented Jun 25, 2020

@VaibhavPage @whynowy I've taken a different approach with Argo Workflows item.go to resource.go in that I delegate to json.RawMessage rather that directly write to []byte. I think that []byte may have issue with null (empty []byte and it does not normalization of the JSON. Please be aware.

@alexec
Copy link
Contributor Author

alexec commented Jun 25, 2020

@sarabala1979 ready for review.

@alexec alexec removed their assignment Jun 25, 2020
Copy link
Member

@sarabala1979 sarabala1979 left a comment

Choose a reason for hiding this comment

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

LGTM

@alexec alexec changed the title fix(controller): Support nested items. Fixes #3288 fix(controller)!: Support nested items. Fixes #3288 Jun 29, 2020
@alexec alexec merged commit 26570fd into argoproj:master Jun 29, 2020
@alexec alexec deleted the fix-3288 branch June 29, 2020 16:40
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.

withParam value could not be parsed as a JSON list with nested list parameters
2 participants