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

[Flow Aggregator] Enclose Pod labels with single quote in s3 uploader #4334

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

dreamtalen
Copy link
Contributor

@dreamtalen dreamtalen commented Oct 24, 2022

In this commit, we updated the s3 uploader inside Flow Aggregator to
enclose Pod label fields with single quote for snowflake usecases.

Because commas are used to separate different columns in CSV and Pod
labels json string contains commas, we enclose Pod labels with single quote to
avoid them being separated into multiple columns in Snowflake.

Changes on Theia side: antrea-io/theia#133

@codecov
Copy link

codecov bot commented Oct 24, 2022

Codecov Report

Merging #4334 (71734d1) into main (835e142) will decrease coverage by 0.57%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4334      +/-   ##
==========================================
- Coverage   64.38%   63.81%   -0.58%     
==========================================
  Files         393      397       +4     
  Lines       55538    56274     +736     
==========================================
+ Hits        35760    35909     +149     
- Misses      17188    17758     +570     
- Partials     2590     2607      +17     
Flag Coverage Δ
e2e-tests 38.95% <ø> (?)
integration-tests 34.48% <ø> (-0.13%) ⬇️
kind-e2e-tests 48.51% <0.00%> (-0.36%) ⬇️
unit-tests 48.18% <100.00%> (+0.03%) ⬆️
Impacted Files Coverage Δ
pkg/flowaggregator/s3uploader/s3uploader.go 85.84% <100.00%> (+0.08%) ⬆️
pkg/features/antrea_features.go 41.02% <0.00%> (-18.98%) ⬇️
pkg/agent/secondarynetwork/podwatch/controller.go 61.69% <0.00%> (-13.13%) ⬇️
pkg/util/runtime/runtime_linux.go 76.00% <0.00%> (-8.00%) ⬇️
pkg/agent/util/sysctl/sysctl_linux.go 59.25% <0.00%> (-7.41%) ⬇️
pkg/agent/controller/trafficcontrol/controller.go 77.95% <0.00%> (-5.55%) ⬇️
pkg/agent/controller/networkpolicy/reject.go 73.39% <0.00%> (-3.95%) ⬇️
pkg/controller/networkpolicy/store/addressgroup.go 88.37% <0.00%> (-3.49%) ⬇️
...ntrollers/multicluster/serviceexport_controller.go 76.33% <0.00%> (-2.80%) ⬇️
pkg/controller/traceflow/controller.go 74.72% <0.00%> (-2.53%) ⬇️
... and 34 more

@dreamtalen dreamtalen force-pushed the fa-sf-label branch 2 times, most recently from 6d35188 to 822d486 Compare October 25, 2022 00:55
In this commit, we updated the s3 uploader inside Flow Aggregator to
enclose Pod label fields with single quote for snowflake usecases.
Because commas are used to separate different columns in CSV and Pod
labels json string contains commas, we enclose it with single quote to
avoid them being separated into multiple columns in Snowflake.

Signed-off-by: Yongming Ding <dyongming@vmware.com>
@antrea-io antrea-io deleted a comment from lgtm-com bot Oct 25, 2022
@dreamtalen dreamtalen changed the title [Flow Aggregator] Enclose Pod labels with single quote for Snowflake usecases [Flow Aggregator] Enclose Pod labels with single quote in s3 uploader Oct 25, 2022
@dreamtalen dreamtalen marked this pull request as ready for review October 25, 2022 18:05
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

@dreamtalen
Copy link
Contributor Author

/test-all

@antoninbas
Copy link
Contributor

/test-e2e
/skip-networkpolicy

@antoninbas antoninbas merged commit 47e6725 into antrea-io:main Oct 27, 2022
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Jan 27, 2023
In this commit, we updated the s3 uploader inside Flow Aggregator to
enclose Pod label fields with single quotes.
Because commas are used to separate different columns in CSV and Pod
labels json-encoded strings contain commas, we enclose them with single
quotes to avoid them being separated into multiple columns when ingested
by data warehouses such as Snowflake.

Signed-off-by: Yongming Ding <dyongming@vmware.com>
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
In this commit, we updated the s3 uploader inside Flow Aggregator to
enclose Pod label fields with single quotes.
Because commas are used to separate different columns in CSV and Pod
labels json-encoded strings contain commas, we enclose them with single
quotes to avoid them being separated into multiple columns when ingested
by data warehouses such as Snowflake.

Signed-off-by: Yongming Ding <dyongming@vmware.com>
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.

3 participants