-
Notifications
You must be signed in to change notification settings - Fork 67
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
Expose source.license through the API #854
Conversation
packages/package.go
Outdated
@@ -121,6 +122,11 @@ type PolicyTemplate struct { | |||
TemplatePath string `config:"template_path,omitempty" json:"template_path,omitempty" yaml:"template_path,omitempty"` | |||
} | |||
|
|||
// Source contains metadata about the source of the package and its distribution. | |||
type Source struct { | |||
License string `config:"license" json:"license"` |
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.
nit: omit empty and yaml?
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.
Added
packages/package.go
Outdated
@@ -82,6 +82,7 @@ type BasePackage struct { | |||
Title *string `config:"title,omitempty" json:"title,omitempty" yaml:"title,omitempty"` | |||
Version string `config:"version" json:"version"` | |||
Release string `config:"release,omitempty" json:"release,omitempty"` | |||
Source *Source `config:"source,omitempty" json:"source,omitempty"` |
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.
Do you want a yaml:"source,omitempty"
here too? This struct inconsistently uses yaml
tags.
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, good point, we should take a look to these differences. @mtojek do you know why there are fields with different sets of annotations?
Thanks @jsoriano! I'll test the changes next week when I am back from PTO. |
Merging this so this is available soon. @jen-huang let me know if this is not enough after your tests, but I think we cannot do something very different to expose this value 🙂 |
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.
LGTM
I tested this for elastic/kibana#137799 and things work fine 👍 Could I trouble you to also include a |
Do you need a real package with a |
No, I don't need a real package, just something to test my local EPR with. I'll try loading up the |
Packages will eventually contain the license of the repository after this change elastic/elastic-package#920 |
Add label indicating the distribution license of the package, as defined in elastic/package-spec#355.
Required by Fleet for elastic/package-spec#298 (elastic/package-spec#298 (comment)).