-
Notifications
You must be signed in to change notification settings - Fork 66
Deduced types #58
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
Deduced types #58
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse 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 |
/assign @jennybuckley |
I'm writing tests now. |
Some types don't have a schema (CRDs), and so we're creating the schema on the fly for these values. We also build the infrastructure to create these types easily and similarly to how we handled existing types.
Since we may not need the schema at all to resolve the path (and now we may not even have it), let's not dereference it until necessary.
93532cd
to
b1fda53
Compare
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.
Looks good to me just a couple questions
|
||
// DeducedParseableType is a ParseableType that deduces the type from | ||
// the content of the object. | ||
type DeducedParseableType struct{} |
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.
Why is DeducedParseableType exported, but parsableType isn't?
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.
Is it because this type is just a struct{} alias?
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.
Because the other one needs to be created in a "fancy way", so it's build through a method that returns the interface?
I could do
func NewDeducedParseableType() ParseableType {
return deducedParseableType{}
}
but I don't think it's very useful
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.
in fewer words, yes =)
FromUnstructured(interface{}) (TypedValue, error) | ||
} | ||
|
||
type parseableType struct { |
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.
Maybe this could be named, schemaParseableType, explicitParseableType or something else (neither of those sound too good to me), to indicate that this one comes from a schema?
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.
Yeah, it's private though so it's less critical?
/lgtm |
No description provided.