-
Notifications
You must be signed in to change notification settings - Fork 6
Update imagePullPolicy... #193
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
base: dev
Are you sure you want to change the base?
Conversation
...to pull the latest mongo:noble version (v8.2.3) and fix cve-2025-14847
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR bumps the Helm chart/app version and changes the MongoDB Deployment to always pull the configured image so that Kubernetes fetches the latest mongo:noble version with CVE fixes on every pod start. Sequence diagram for MongoDB pod start with imagePullPolicy AlwayssequenceDiagram
actor Dev
participant Helm as Helm_chart_protes_2_0_1
participant KAPI as Kubernetes_APIServer
participant Kubelet as Node_Kubelet
participant CR as Container_Registry
participant Pod as MongoDB_Pod
Dev->>Helm: helm upgrade --install protes
Helm->>KAPI: Apply MongoDB Deployment (imagePullPolicy Always)
KAPI->>Kubelet: Schedule MongoDB Pod
Kubelet->>CR: Pull mongo_noble_latest image (Always)
CR-->>Kubelet: Image layers
Kubelet->>Pod: Create container from latest image
Pod-->>Dev: MongoDB ready with latest patched image
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey - I've found 1 issue, and left some high level feedback:
- Hardcoding
imagePullPolicy: Alwaysin the deployment could introduce unnecessary image pulls in production; consider making the pull policy configurable viavalues.yamland defaulting it appropriately. - To reliably address CVE-2025-14847, it may be safer to pin the MongoDB image to an explicit version or digest rather than relying on
latest-like behavior, so that upgrades are controlled and reproducible.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Hardcoding `imagePullPolicy: Always` in the deployment could introduce unnecessary image pulls in production; consider making the pull policy configurable via `values.yaml` and defaulting it appropriately.
- To reliably address CVE-2025-14847, it may be safer to pin the MongoDB image to an explicit version or digest rather than relying on `latest`-like behavior, so that upgrades are controlled and reproducible.
## Individual Comments
### Comment 1
<location> `deployment/templates/mongodb/mongodb-deployment.yaml:45` </location>
<code_context>
name: {{ .Values.mongodb.appName }}
image: {{ .Values.mongodb.image }}
- imagePullPolicy: IfNotPresent
+ imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
</code_context>
<issue_to_address>
**suggestion:** Consider making the MongoDB imagePullPolicy configurable via values.yaml rather than hard-coding `Always`.
Hard-coding `imagePullPolicy: Always` can cause issues in production (e.g., private registries, rate limits, or clusters without external registry access). Exposing this as something like `.Values.mongodb.imagePullPolicy` with a sane default would keep flexibility while still allowing `Always` where required.
Suggested implementation:
```
image: {{ .Values.mongodb.image }}
imagePullPolicy: {{ .Values.mongodb.imagePullPolicy | default "IfNotPresent" }}
```
1. In `values.yaml`, add a configurable value with a sane default, for example:
```yaml
mongodb:
imagePullPolicy: IfNotPresent
```
2. If there is documentation for chart values (e.g., README or values reference), document `mongodb.imagePullPolicy` as an optional override, mentioning that it defaults to `IfNotPresent` but can be set to `Always` when needed.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| name: {{ .Values.mongodb.appName }} | ||
| image: {{ .Values.mongodb.image }} | ||
| imagePullPolicy: IfNotPresent | ||
| imagePullPolicy: Always |
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.
suggestion: Consider making the MongoDB imagePullPolicy configurable via values.yaml rather than hard-coding Always.
Hard-coding imagePullPolicy: Always can cause issues in production (e.g., private registries, rate limits, or clusters without external registry access). Exposing this as something like .Values.mongodb.imagePullPolicy with a sane default would keep flexibility while still allowing Always where required.
Suggested implementation:
image: {{ .Values.mongodb.image }}
imagePullPolicy: {{ .Values.mongodb.imagePullPolicy | default "IfNotPresent" }}
- In
values.yaml, add a configurable value with a sane default, for example:mongodb: imagePullPolicy: IfNotPresent
- If there is documentation for chart values (e.g., README or values reference), document
mongodb.imagePullPolicyas an optional override, mentioning that it defaults toIfNotPresentbut can be set toAlwayswhen needed.
...to pull the latest mongo:noble version (v8.2.3) and fix cve-2025-14847
IMPORTANT: Please create an issue before filing a pull request! Changes need to be discussed before proceeding. Please read the contribution guidelines.
Details
Please provide enough information so that others can review your pull request. Give a brief summary of the motivation. Refer to the corresponding issue/s with
#XXXXfor more information.Testing
Write the appropriate unit and integration tests, if applicable. Make sure these and all other tests pass.
Documentation
Please document your changes and test cases in the appropriate places, if applicable.
Style
Make sure your changes adhere to the coding/documentation style used throughout the project.
Closing issues
If your changes fix any issue/s, put
closes #XXXXin your comment to auto-close it/them.Credit
Add your credentials to the list of contributors once your pull request was merged.
Summary by Sourcery
Bump the Helm chart and application version and adjust MongoDB deployment configuration to always pull the specified image.
Enhancements: