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 #4358

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

aorcholski
Copy link
Contributor

JIRA

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 added the bug Something isn't working label Jan 27, 2025
@aorcholski aorcholski requested a review from a team as a code owner January 27, 2025 15:55
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2025

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

Codecov Report

Attention: Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.

Project coverage is 64.18%. Comparing base (bcecbd0) to head (c9f8acb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/csi/init/cmd.go 0.00% 1 Missing ⚠️
cmd/csi/provisioner/cmd.go 0.00% 1 Missing ⚠️
cmd/csi/server/cmd.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             @@
##             main    #4358      +/-   ##
==========================================
- Coverage   64.19%   64.18%   -0.01%     
==========================================
  Files         401      401              
  Lines       26320    26331      +11     
==========================================
+ Hits        16895    16901       +6     
- Misses       8121     8126       +5     
  Partials     1304     1304              
Flag Coverage Δ
unittests 64.18% <64.28%> (-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.

cmd/support_archive/builder.go Outdated Show resolved Hide resolved
@aorcholski aorcholski force-pushed the bugfix/corrupted-sup-arch branch from d2cf1e0 to c5df56d Compare January 28, 2025 10:15
@aorcholski aorcholski force-pushed the bugfix/corrupted-sup-arch branch from d18be9f to c9f8acb Compare January 28, 2025 10:53
@aorcholski aorcholski merged commit b214c71 into main Jan 28, 2025
19 checks passed
@aorcholski aorcholski deleted the bugfix/corrupted-sup-arch branch January 28, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants