-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: remove easyjson dependency #34
refactor: remove easyjson dependency #34
Conversation
Signed-off-by: Fabrizio Sestito <[email protected]>
Signed-off-by: Fabrizio Sestito <[email protected]>
Signed-off-by: Fabrizio Sestito <[email protected]>
Signed-off-by: Fabrizio Sestito <[email protected]>
settings.go
Outdated
type RawSettings struct { | ||
DeniedLabels []string `json:"denied_labels"` | ||
MandatoryLabels []string `json:"mandatory_labels"` | ||
ConstrainedLabels map[string]string `json:"constrained_labels"` | ||
} |
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.
We should merge RawSettings
with Settings
, this was just a workaround caused by easyjson not supporting properly mapset
. Can you give a shot at unmarshalling the json straight into Settings
?
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.
refactored in: 2fd4d59
Implemented json.Unmarshaler
for Settings
, but kept an anonymous struct similar to RawSettings
to simplify the unmarshalling.
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, modulo Flavio's comment.
Signed-off-by: Fabrizio Sestito <[email protected]>
b4b836f
to
c322882
Compare
c322882
to
2fd4d59
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.
I love the new approach to handle Settings
and RawSettings
👏
Description
Removes the easyjson dependency by bumping
policy-sdk
to the latest version.Test
Existing tests should pass.
Additional Information
Artifact hub configuration was updated.
Related to: kubewarden/kubewarden-controller#492