This repository has been archived by the owner on Jun 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
IPReservationRequest: change type of attribute CustomData to interface{} #221
Merged
displague
merged 3 commits into
equinixmetal-archive:master
from
t0mk:custom_data_in_reserved_ip_to_string
Dec 9, 2020
+37
−30
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
map[string]interface{}
tests should still work, do they not? These would save JSON structures in the EM API, and would result in JSON structures in return.The updated tests will be storing strings and I assume receiving strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we established that there can be non-map types coming from the EM API (strings, lists, numbers). Then, map[string]interface{} woulndn't work I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t0mk you can ignore that comment, I believe it is from before the investigation and discovery of how customdata is stored and delivered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misunderstood myself :-)
I mean, we should still be able to test with:
customData := map[string]interface{}{"custom1": "data", "custom2": map[string]interface{}{"nested": "data"}}
. This would verify that arbitrary json structures are stored in their native format and returned the same.By testing with:
we are verifying that scalars (string) work, and we could test with a simpler string
foo
to prove that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both tests should be valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you mean the concrete testing value in the Public IP reservation test. You're right that nested map[string]interface{} is more fitting here, thanks. I overlooked that there was still a string. I fixed it.
I also changed the name of this PR.