-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add affinity and tolerations to ASOv2 helm chart #3765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but consider using the slightly more robust but also moderately more horrible perl line above, to capture spaces.
scripts/v2/generate-helm-manifest.sh
Outdated
@@ -49,6 +49,10 @@ sed -i "s@$LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE@{{.Values.image.repository}}@g | |||
# Perl multiline replacements - using this because it's tricky to do these sorts of multiline replacements with sed | |||
perl -0777 -i -pe 's/(template:\n.*metadata:\n.*annotations:\n(\s*))/$1\{\{- if .Values.podAnnotations \}\}\n$2\{\{ toYaml .Values.podAnnotations \}\}\n$2\{\{- end \}\}\n$2/igs' "$GEN_FILES_DIR"/*_deployment_* # Add pod annotations | |||
|
|||
# Affinity and Toleration | |||
sed -i '/ spec:/a\ {{- with .Values.affinity }}\n affinity:\n {{- toYaml . | nindent 8 }}\n {{- end }}' "$GEN_FILES_DIR"/*_deployment_* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might wanna steal the (horrible) perl line above as it captures spaces and so deals with variable indentation?
I assume that you've tested and this works have we have it today... we really should probably fix how we generate the Helm template (might be better to just duplicate stuff, I dunno)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with either. Perl looks a bit messy. But good point, it takes care of the spaces.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3765 +/- ##
==========================================
- Coverage 53.54% 53.49% -0.05%
==========================================
Files 1417 1419 +2
Lines 484060 483386 -674
==========================================
- Hits 259177 258603 -574
+ Misses 185651 185629 -22
+ Partials 39232 39154 -78 ☔ View full report in Codecov by Sentry. |
Closes #3646
What this PR does / why we need it:
This PR adds changes to the helm chart generation script to add
Affinity
andTolerations
to ASOv2 helm chart. Also updatesvalues.yaml
to specify the above.