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

Added assign_if transformation #276

Merged
merged 1 commit into from
Aug 2, 2022
Merged

Conversation

tkuldeep
Copy link
Contributor

@tkuldeep tkuldeep commented Aug 2, 2022

Fixes #275
Signed-off-by: Kuldeep Singh Pal tkuldeep.allen@gmail.com

@codecov-commenter
Copy link

Codecov Report

Merging #276 (dc5ee2a) into main (6c1dae1) will increase coverage by 0.01%.
The diff coverage is 72.72%.

@@            Coverage Diff             @@
##             main     #276      +/-   ##
==========================================
+ Coverage   66.83%   66.85%   +0.01%     
==========================================
  Files          73       73              
  Lines        4149     4160      +11     
==========================================
+ Hits         2773     2781       +8     
- Misses       1197     1199       +2     
- Partials      179      180       +1     
Flag Coverage Δ
unittests 66.85% <72.72%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/api/transform_network.go 100.00% <ø> (ø)
pkg/pipeline/transform/transform_network.go 61.87% <72.72%> (+0.80%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

@@ -95,6 +95,18 @@ func (n *Network) TransformEntry(inputEntry config.GenericMap) config.GenericMap
outputEntry[rule.Output] = outputEntry[rule.Input]
outputEntry[rule.Output+"_Evaluate"] = true
}
case api.TransformNetworkOperationName("AssignIf"):
expressionString := fmt.Sprintf("val %s", rule.Parameters)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Eran asked to combine the AssignIf into the existing AddIf. The code is essentially the same, with the exception of what gets assigned to the the Output variable. If an assigned value is provided, it gets the new value; otherwise it gets the value of the Input variable.

Fixes netobserv#275

Signed-off-by: Kuldeep Singh Pal <tkuldeep.allen@gmail.com>
@KalmanMeth KalmanMeth merged commit d7656a2 into netobserv:main Aug 2, 2022
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.

Add option for transforming to some custom values on the basis of some parameters
4 participants