Conversation
WalkthroughAdds a new administrator documentation page describing how to prune ACP’s internal cluster image registry using Changes
Sequence Diagram(s)(omitted — changes are documentation-only and do not introduce new runtime control flow) Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md (1)
14-14: Tighten wording for readabilityLine 14 reads awkwardly (
internal registry of cluster). A small wording cleanup improves clarity.💡 Suggested patch
-This document provides a practical and production-ready approach for cleaning images in ACP's internal registry of cluster and automating the cleanup process with `CronJob`. +This document provides a practical, production-ready approach for cleaning images in ACP's internal cluster registry and automating cleanup with `CronJob`.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md` at line 14, Summary: The sentence "This document provides a practical and production-ready approach for cleaning images in ACP's internal registry of cluster and automating the cleanup process with `CronJob`." is awkwardly worded; change it to improve clarity. Replace "internal registry of cluster" with "the cluster's internal registry" (or "the internal registry of the cluster") and add a comma before "and automating" so the sentence reads smoothly, e.g., "This document provides a practical, production-ready approach for cleaning images in ACP's cluster internal registry, and automating the cleanup process with `CronJob`." Locate and edit the sentence in the document (the line starting with "This document provides a practical...") to apply this wording fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md`:
- Around line 256-257: The scenarios reference serviceAccountName: ac-tester-sa
but the runnable RBAC creates ac-images-pruner-sa, causing SA-not-found errors;
update each scenario YAML that sets serviceAccountName (instances containing
"serviceAccountName: ac-tester-sa") to use "ac-images-pruner-sa" instead so they
match the RBAC setup (replace all occurrences of ac-tester-sa with
ac-images-pruner-sa in the CronJob/Job scenario blocks).
- Line 385: The docs use the CronJob name ac-prune-images-daily when collecting
logs, but you must use an actual Job instance name; replace the example command
"ac logs job/ac-prune-images-daily -n cpaas-system" with a two-step approach:
list Jobs to find the real instance (e.g., run "kubectl get jobs -n
cpaas-system" and locate the job whose name starts with
ac-prune-images-daily-<timestamp>) and then run "kubectl logs
job/<actual-job-name> -n cpaas-system" (use the actual Job name that starts with
ac-prune-images-daily) to collect logs.
---
Nitpick comments:
In
`@docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md`:
- Line 14: Summary: The sentence "This document provides a practical and
production-ready approach for cleaning images in ACP's internal registry of
cluster and automating the cleanup process with `CronJob`." is awkwardly worded;
change it to improve clarity. Replace "internal registry of cluster" with "the
cluster's internal registry" (or "the internal registry of the cluster") and add
a comma before "and automating" so the sentence reads smoothly, e.g., "This
document provides a practical, production-ready approach for cleaning images in
ACP's cluster internal registry, and automating the cleanup process with
`CronJob`." Locate and edit the sentence in the document (the line starting with
"This document provides a practical...") to apply this wording fix.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 877ab4b4-a49f-4c21-a730-ccd011c1cf29
📒 Files selected for processing (1)
docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md
...tions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md
Outdated
Show resolved
Hide resolved
...tions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md
Show resolved
Hide resolved
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md (1)
475-476:⚠️ Potential issue | 🟠 MajorUse a real Job instance name for log collection
Line 475 uses the CronJob name as a Job name. CronJob runs create generated Job names, so this command can fail during normal execution. Replace with a two-step lookup + logs flow.
💡 Suggested patch
-ac logs job/ac-prune-images-daily -n cpaas-system +ac get jobs -n cpaas-system --sort-by=.metadata.creationTimestamp +# Pick the latest Job created by CronJob `ac-prune-images-daily`, then: +ac logs job/<actual-job-name> -n cpaas-systemIn Kubernetes CronJob behavior, what naming pattern do spawned Jobs use, and should logs be fetched via `kubectl logs job/<cronjob-name>` or via the actual generated Job name?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md` around lines 475 - 476, The command uses the CronJob name directly (ac-prune-images-daily) but CronJobs spawn Jobs with generated names like ac-prune-images-daily-<timestamp|hash>, so replace the single-line "ac logs job/ac-prune-images-daily -n cpaas-system" with a two-step lookup + logs flow: first list or filter Jobs for the spawned name (e.g., use "kubectl get jobs -n cpaas-system" and find entries starting with "ac-prune-images-daily-" or use a label/selector for the CronJob), then run "kubectl logs job/<generated-job-name> -n cpaas-system" to fetch logs from the actual Job instance; update any references to ac-prune-images-daily accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In
`@docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md`:
- Around line 475-476: The command uses the CronJob name directly
(ac-prune-images-daily) but CronJobs spawn Jobs with generated names like
ac-prune-images-daily-<timestamp|hash>, so replace the single-line "ac logs
job/ac-prune-images-daily -n cpaas-system" with a two-step lookup + logs flow:
first list or filter Jobs for the spawned name (e.g., use "kubectl get jobs -n
cpaas-system" and find entries starting with "ac-prune-images-daily-" or use a
label/selector for the CronJob), then run "kubectl logs job/<generated-job-name>
-n cpaas-system" to fetch logs from the actual Job instance; update any
references to ac-prune-images-daily accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 705baf5c-4d3b-432a-95aa-d1e71d98997a
📒 Files selected for processing (1)
docs/en/solutions/How_to_Cleanup_Alauda_Container_Platform_Cluster_Image_Registry_Administrator_Guide.md
vivindu-1213
left a comment
There was a problem hiding this comment.
标题是不是可以稍微调整下?
Implementation Steps 算是 Quick Start: Manual Cleanup?
Configure Scheduled Cleanup with CronJob 定时执行 Automating Cleanup with CronJob?
Fully Runnable Example (Dry Run Recommended)”与“Scenario-Based Demos”内容感觉有点冗余...或者整合下,提供 Important Considerations & Best Practices?
|
|
||
| ### Step 3: Run confirmed cleanup with policy | ||
|
|
||
| Keep younger than 7 days, keep latest 5 revisions per repository, and exclude images in `cpaas-system` namespace, confirm the cleanup operation. |
There was a problem hiding this comment.
keep yonger than ...这句话的描述不太合适...语法也不是很顺畅
|
|
||
| ### Step 4: Trigger GC when required | ||
|
|
||
| Keep younger than 3 days, keep latest 3 revisions per repository, and trigger registry GC in non-dry-run mode, confirm the cleanup operation. |
|
文档中既有 |
| Check logs for details: | ||
|
|
||
| ```bash | ||
| ac logs job/ac-prune-images-daily -n cpaas-system |
There was a problem hiding this comment.
建议修改 job 示例名称,job/ac-prune-images-daily 在上文示例中为 cronjob 名称。
Summary by CodeRabbit