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

Removes a log message that corrupts support_archive zip package (release-1.4) #4374

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

aorcholski
Copy link
Contributor

JIRA

PR-4358 for the main branch

Description

At startup, the operator immediately issues a log line :

{"level":"info","ts":"2025-01-27T14:02:26.877Z","logger":"install-config","msg":"envvar content read and set","envvar":"modules.json","value":"..."} 
PK^C^D^T...

which precedes the first ZIP header so the package can't be unpacked by some implementations of zip command.

Changes:

  • removed global initialization of the Modules from v1beta1(2)/convert_from packages to fix support_archive command
  • GetModules function is called by all operator subcommands to put the message at the beginning of a log file

How can this be tested?

kubectl exec -n dynatrace deployment/dynatrace-operator -- dynatrace-operator support-archive --stdout > operator-support-archive.zip

operator-support-archive.zip should be decompressed with no errors.

supportarchive_console.log contains the message :

[support-archive]       envvar content read and set     {"envvar": "modules.json", "value": "{\n  \"csiDriver\": true,\n  \"activeGate\": true,\n  \"oneAgent\": true,\n  \"extensions\": true,\n  \"logMonitoring\": true,\n  \"edgeConnect\": true,\n  \"supportability\": true,\n  \"kspm\": true\n}\n"}
[support-archive]       dynatrace-operator      {"version": "snapshot-bugfix-corrupted-sup-arch", "gitCommit": "f00e14a06a6c72f33d7906ca07e441546802f412", "buildDate": "2025-01-27T15:29:01+00:00", "goVersion": "go1.23.5", "platform": "linux/amd64"} 
...

@aorcholski aorcholski requested a review from a team as a code owner January 28, 2025 13:50
@aorcholski aorcholski requested review from andriisoldatenko, gkrenn, 0sewa0, chrismuellner, waodim and StefanHauth and removed request for a team January 28, 2025 13:50
@aorcholski aorcholski force-pushed the bugfix/corrupted-sup-arch-1-4 branch from d4aec5a to 97977a1 Compare January 28, 2025 13:53
@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Project coverage is 64.20%. Comparing base (7d41bdc) to head (97977a1).
Report is 1 commits behind head on release-1.4.

Files with missing lines Patch % Lines
cmd/csi/init/builder.go 0.00% 1 Missing ⚠️
cmd/support_archive/builder.go 0.00% 1 Missing ⚠️
cmd/webhook/builder.go 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##           release-1.4    #4374   +/-   ##
============================================
  Coverage        64.19%   64.20%           
============================================
  Files              401      401           
  Lines            26999    27010   +11     
============================================
+ Hits             17333    17341    +8     
- Misses            8299     8302    +3     
  Partials          1367     1367           
Flag Coverage Δ
unittests 64.20% <78.57%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aorcholski aorcholski merged commit 2973906 into release-1.4 Jan 28, 2025
18 checks passed
@aorcholski aorcholski deleted the bugfix/corrupted-sup-arch-1-4 branch January 28, 2025 14:03
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.

4 participants