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

Improve handling of config changes in FlowAggregator #6378

Conversation

antoninbas
Copy link
Contributor

Prior to this change, only updates to the configuration of exporters (sinks) were handled gracefully, without requiring a FlowAggregator restart.
After this change, we also support updating recordContents.podLabels at runtime.
For all other unsupported config changes, we print an error log, asking users to restart the FlowAggregator.

@antoninbas antoninbas added area/flow-visibility/aggregator Issues or PRs related to Flow Aggregator action/release-note Indicates a PR that should be included in release notes. labels May 28, 2024
yuntanghsu
yuntanghsu previously approved these changes May 28, 2024
Copy link
Contributor

@yuntanghsu yuntanghsu left a comment

Choose a reason for hiding this comment

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

LGTM

klog.InfoS("Updated RecordContents.PodLabels configuration", "value", fa.includePodLabels)
}
var unsupportedUpdates []string
if opt.Config.APIServer != fa.APIServer {
Copy link
Contributor

@yuntanghsu yuntanghsu May 28, 2024

Choose a reason for hiding this comment

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

I think golang can check the contents in the struct (we only have int and string in APIServer)?

tnqn
tnqn previously approved these changes May 29, 2024
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM, one typo

@@ -440,6 +441,35 @@ func TestFlowAggregator_updateFlowAggregator(t *testing.T) {
mockLogExporter.EXPECT().UpdateOptions(opt)
flowAggregator.updateFlowAggregator(opt)
})
t.Run("includePodLables", func(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
t.Run("includePodLables", func(t *testing.T) {
t.Run("includePodLabels", func(t *testing.T) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks

Prior to this change, only updates to the configuration of exporters
(sinks) were handled gracefully, without requiring a FlowAggregator
restart.
After this change, we also support updating recordContents.podLabels at
runtime.
For all other unsupported config changes, we print an error log, asking
users to restart the FlowAggregator.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
@antoninbas antoninbas dismissed stale reviews from tnqn and yuntanghsu via f24fea7 May 29, 2024 16:37
@antoninbas antoninbas force-pushed the fa-improve-handling-of-unsupported-config-changes branch from 30c98b0 to f24fea7 Compare May 29, 2024 16:37
@antoninbas antoninbas changed the title Imporve handling of config changes in FlowAggregator Improve handling of config changes in FlowAggregator May 29, 2024
@antoninbas antoninbas requested a review from tnqn May 29, 2024 16:38
Copy link
Contributor

@heanlan heanlan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@antoninbas antoninbas merged commit b3ef929 into antrea-io:main May 30, 2024
45 of 54 checks passed
@antoninbas antoninbas deleted the fa-improve-handling-of-unsupported-config-changes branch May 30, 2024 17:41
antoninbas added a commit to antoninbas/antrea that referenced this pull request May 30, 2024
This is a partial revert of antrea-io#6378.
We cannot easily support live updates to recordContents.podLabels, as it
requires re-creating the IPFIXExporter, so that a new IPFIX template set
can be sent.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. area/flow-visibility/aggregator Issues or PRs related to Flow Aggregator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants