[Helm Chart] only add annotations stanza if they are annotations to add #2580
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
when deploying with argocd and with existing KEDA, we want to deploy the scaledJob without helm hooks, since the template for those objects doesn't check if they annotations exist, when passing null to the annotations section in the values.yaml, it will cause argocd to be in a content state of diff with the templated yaml file.
Description
this PR wraps the annotations section of the scaledJobs template in an if statement, only if there are annotations it will create that section, if they are none, that annotations key is not templated.
Motivation and Context
to not have constant diff in argocd when deploying seleniun grid with the chart and with existing keda without helm hooks
Types of changes
Checklist
PR Type
Bug fix
Description
Added conditional logic for
annotations
in ScaledJob templates.Prevents unnecessary diffs in ArgoCD when annotations are null.
Updated templates for Chrome, Edge, Firefox, and Relay nodes.
Ensures compatibility with existing KEDA deployments without Helm hooks.
Changes walkthrough 📝
chrome-node-scaledjobs.yaml
Add conditional annotations logic for Chrome node
charts/selenium-grid/templates/chrome-node-scaledjobs.yaml
if
condition to include annotations only if defined.edge-node-scaledjob.yaml
Add conditional annotations logic for Edge node
charts/selenium-grid/templates/edge-node-scaledjob.yaml
if
condition to include annotations only if defined.firefox-node-scaledjob.yaml
Add conditional annotations logic for Firefox node
charts/selenium-grid/templates/firefox-node-scaledjob.yaml
if
condition to include annotations only if defined.relay-node-scaledjobs.yaml
Add conditional annotations logic for Relay node
charts/selenium-grid/templates/relay-node-scaledjobs.yaml
if
condition to include annotations only if defined.