fix: replace abandoned golangci-lint install script in builder image#972
Conversation
The master-branch install.sh fails checksum verification; use the official golangci-lint.run URL and redeclare the version ARG after FROM. Co-authored-by: Cursor <cursoragent@cursor.com>
WalkthroughThe Dockerfile adds a Changesgolangci-lint installation
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@make.Dockerfile`:
- Line 7: Update the yum installation RUN command to clean yum metadata and
remove remaining package-manager caches in the same image layer after installing
ca-certificates, git, go-toolset, and make. Keep the existing package
installation behavior unchanged while ensuring no yum cache remains in the
resulting image.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 98e9d35a-c8fd-412b-a68f-582dc7c06804
📒 Files selected for processing (1)
make.Dockerfile
|
|
||
| ARG GOLANGCI_LINT_VERSION | ||
|
|
||
| RUN yum install -y ca-certificates git go-toolset make |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
Clean yum metadata after installation.
Add yum clean all (and remove the remaining cache) in the same layer to avoid unnecessarily inflating the containerized lint/test image.
Proposed fix
-RUN yum install -y ca-certificates git go-toolset make
+RUN yum install -y ca-certificates git go-toolset make \
+ && yum clean all \
+ && rm -rf /var/cache/yum📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| RUN yum install -y ca-certificates git go-toolset make | |
| RUN yum install -y ca-certificates git go-toolset make \ | |
| && yum clean all \ | |
| && rm -rf /var/cache/yum |
🧰 Tools
🪛 Trivy (0.69.3)
[error] 7-7: 'yum clean all' missing
'yum clean all' is missed: yum install -y ca-certificates git go-toolset make
Rule: DS-0015
(IaC/Dockerfile)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@make.Dockerfile` at line 7, Update the yum installation RUN command to clean
yum metadata and remove remaining package-manager caches in the same image layer
after installing ca-certificates, git, go-toolset, and make. Keep the existing
package installation behavior unchanged while ensuring no yum cache remains in
the resulting image.
Source: Linters/SAST tools
|
@MitaliBhalla: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #972 +/- ##
==========================================
- Coverage 54.58% 54.54% -0.04%
==========================================
Files 82 82
Lines 6308 6308
==========================================
- Hits 3443 3441 -2
- Misses 2416 2417 +1
- Partials 449 450 +1 🚀 New features to boost your workflow:
|
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MitaliBhalla, samanthajayasinghe The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
make.Dockerfilefrom the abandonedmasterbranchinstall.sh(checksum failures) to the officialhttps://golangci-lint.run/install.sh.GOLANGCI_LINT_VERSIONafterFROMso the pinned version is actually available in the builder stage.Test plan
make build-imagesucceedsmake lint-in-container/make test-in-containersucceedMade with Cursor
Summary by CodeRabbit