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

Reject dynakubes that use public image and not read only oneAgents (release-1.4) #4346

Merged
merged 3 commits into from
Jan 29, 2025

Conversation

waodim
Copy link
Contributor

@waodim waodim commented Jan 24, 2025

Description

Ticket

Previously when a dynakube was applied that had a mode that does not use read only oneagents (so everything that is not cloudNative or hostMon with csi) and a custom image (which we interpret as public images) then the oneAgent pods would run into a CrashLoopBackOff error.

In the pods you'd find this message:

❯ k logs daemonsets/cfg-oneagent
Found 3 pods, using pod/cfg-oneagent-2ghqj
[2025-01-22 13:41:58.584 UTC] [000a1650] [info   ] [bootstrapper] Started agent deployment as a container, PID 661072
[2025-01-22 13:41:58.586 UTC] [000a1650] [error  ] [bootstrapper] Volume storage should be mounted on /mnt/volume_storage_mount with write permissions

With this PR this configuration is now rejected in the first place.

How can this be tested?

Try those modes in combination with a custom image

example:

helm install dynatrace-operator -n dynatrace oci://public.ecr.aws/dynatrace/dynatrace-operator --version 1.4.0 -n dynatrace --set csidriver.enabled=false

spec:
  oneAgent:
    hostMonitoring:
      image: public.ecr.aws/dynatrace/dynatrace-oneagent:1.305.98.20250114-172617

@waodim waodim added the bug Something isn't working label Jan 24, 2025
@waodim waodim requested a review from a team as a code owner January 24, 2025 08:12
@waodim waodim requested review from andriisoldatenko, gkrenn, 0sewa0, chrismuellner, StefanHauth and aorcholski and removed request for a team January 24, 2025 08:12
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.20%. Comparing base (de0a82b) to head (8a449d3).
Report is 1 commits behind head on release-1.4.

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

Additional details and impacted files
@@             Coverage Diff              @@
##           release-1.4    #4346   +/-   ##
============================================
  Coverage        64.20%   64.20%           
============================================
  Files              401      401           
  Lines            27010    27015    +5     
============================================
+ Hits             17341    17346    +5     
  Misses            8302     8302           
  Partials          1367     1367           
Flag Coverage Δ
unittests 64.20% <100.00%> (+<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.

@@ -23,6 +23,8 @@ Use a nodeSelector to avoid this conflict. Conflicting DynaKubes: %s`

errorVolumeStorageReadOnlyModeConflict = `The DynaKube specification specifies a read-only host file system while OneAgent has volume storage enabled.`

errorPublicImageWithWrongConfig = `The DynaKube specification specifies a custom (and therefor probably a public) image in combination with a mode that needs write permissions for volume mounts.`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
errorPublicImageWithWrongConfig = `The DynaKube specification specifies a custom (and therefor probably a public) image in combination with a mode that needs write permissions for volume mounts.`
errorPublicImageWithWrongConfig = `Custom OneAgent image is only supported when CSI Driver is used.`

It would be much nicer to have a guide in the official documentation to link to explaining the feature flag, but for now I think we can boil it down to this.

@StefanHauth StefanHauth changed the title Reject dynakubes that use public image and not read only oneAgents Reject dynakubes that use public image and not read only oneAgents (release-1.4) Jan 28, 2025
@StefanHauth StefanHauth enabled auto-merge (squash) January 29, 2025 11:44
@StefanHauth StefanHauth merged commit 568cd54 into release-1.4 Jan 29, 2025
15 checks passed
@StefanHauth StefanHauth deleted the bugfix/readonly-oa-public-image branch January 29, 2025 11:53
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.

6 participants