-
Couldn't load subscription status.
- Fork 662
fix: remove duplicates from imagePullSecrets #3923
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
Conversation
Signed-off-by: Julien Mancuso <[email protected]>
WalkthroughThe pull request updates Kubernetes service discovery configuration in the Helm deployment template to append the DNS suffix Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
deploy/cloud/operator/internal/dynamo/graph.go (1)
862-875: Consider deterministic ordering for predictability.The map iteration on line 871 produces non-deterministic ordering, which could cause instability in intermediate stages (e.g., debugging, logging). While
CanonicalizePodSpecsorts secrets later, it's better to maintain deterministic behavior throughout.Apply this diff to preserve existing order and append new unique secrets:
func ensureUniqueImagePullSecrets(existing, new []corev1.LocalObjectReference) []corev1.LocalObjectReference { if len(existing) == 0 && len(new) == 0 { return nil } - uniqueSecrets := make(map[string]corev1.LocalObjectReference) - for _, secret := range append(existing, new...) { - uniqueSecrets[secret.Name] = secret + seen := make(map[string]bool) + result := make([]corev1.LocalObjectReference, 0, len(existing)+len(new)) + + // Add existing secrets first + for _, secret := range existing { + if !seen[secret.Name] { + seen[secret.Name] = true + result = append(result, secret) + } } - uniqueSecretsList := make([]corev1.LocalObjectReference, 0, len(uniqueSecrets)) - for _, secret := range uniqueSecrets { - uniqueSecretsList = append(uniqueSecretsList, secret) + + // Add new secrets that aren't duplicates + for _, secret := range new { + if !seen[secret.Name] { + seen[secret.Name] = true + result = append(result, secret) + } } - return uniqueSecretsList + + return result }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
deploy/cloud/helm/platform/components/operator/templates/deployment.yaml(1 hunks)deploy/cloud/operator/internal/dynamo/graph.go(1 hunks)deploy/cloud/operator/internal/dynamo/graph_test.go(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#1474
File: deploy/cloud/operator/internal/controller/dynamocomponent_controller.go:1308-1312
Timestamp: 2025-06-11T21:29:28.650Z
Learning: User julienmancuso expects replies in English; avoid switching languages unless explicitly requested.
🧬 Code graph analysis (1)
deploy/cloud/operator/internal/dynamo/graph.go (1)
deploy/cloud/operator/internal/controller_common/pod.go (1)
CanonicalizePodSpec(12-277)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: operator (arm64)
- GitHub Check: vllm (amd64)
- GitHub Check: trtllm (arm64)
- GitHub Check: sglang
- GitHub Check: vllm (arm64)
- GitHub Check: operator (amd64)
- GitHub Check: Build and Test - dynamo
🔇 Additional comments (3)
deploy/cloud/helm/platform/components/operator/templates/deployment.yaml (1)
90-90: LGTM: FQDN for NATS and ETCD addressesAppending
.svc.cluster.localto the service addresses is a good practice that makes the DNS lookups explicit and more portable.Also applies to: 95-95
deploy/cloud/operator/internal/dynamo/graph.go (1)
856-856: Good: Deduplication prevents duplicate imagePullSecrets.Replacing direct concatenation with
ensureUniqueImagePullSecretsproperly addresses the PR objective to remove duplicates.deploy/cloud/operator/internal/dynamo/graph_test.go (1)
5209-5268: LGTM: Comprehensive test coverage for deduplication.The test covers the key scenarios (no secrets, combination, and deduplication) and properly sorts results before comparison to handle non-deterministic ordering.
Signed-off-by: Julien Mancuso <[email protected]>
Overview:
remove duplicates from imagePullSecrets
Summary by CodeRabbit
Bug Fixes
Chores
Tests