Conversation
WalkthroughThis change updates the assignment of Changes
Sequence Diagram(s)sequenceDiagram
participant EKS_Sync as EKS Sync Logic
participant RelationshipRules as Relationship Rules
EKS_Sync->>RelationshipRules: Define relationship with updated Kind/Version assignments
Possibly related PRs
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| SourceKind: "AWSElasticKubernetesService", | ||
| SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1", | ||
| TargetKind: "AWSNetwork", | ||
| TargetVersion: "ctrlplane.dev/network/v1", |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Approve: This change correctly aligns field semantics with field names.
The swap of values between Kind and Version fields is appropriate. Now "Kind" fields properly contain resource type identifiers, while "Version" fields hold API group/version paths. This matches how these fields are used elsewhere in the code (e.g., in the api.AgentResource struct at line 209-212).
🏁 Script executed:
#!/bin/bash
# Check if there are other similar relationship rules in the codebase
# that might need the same correction for consistency
# Find all usages of CreateResourceRelationshipRule to verify field naming conventions
rg -A 10 "CreateResourceRelationshipRule" --type goLength of output: 6955
Approve EKS change; align RDS and CloudSQL as well
The swap in cmd/ctrlc/root/sync/aws/eks/eks.go correctly matches Kind ↔ Version semantics. For consistency, please apply the same fixes to:
• cmd/ctrlc/root/sync/aws/rds/rds.go
• cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go
Suggested diffs:
// cmd/ctrlc/root/sync/aws/rds/rds.go
- SourceKind: "ctrlplane.dev/database/v1",
- SourceVersion: "AWSRelationalDatabaseService",
+ SourceKind: "AWSRelationalDatabaseService",
+ SourceVersion: "ctrlplane.dev/database/v1",
- TargetKind: "ctrlplane.dev/network/v1",
- TargetVersion: "AWSNetwork",
+ TargetKind: "AWSNetwork",
+ TargetVersion: "ctrlplane.dev/network/v1",// cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go
- SourceKind: "ctrlplane.dev/database/v1",
- SourceVersion: "GoogleCloudSQL",
+ SourceKind: "GoogleCloudSQL",
+ SourceVersion: "ctrlplane.dev/database/v1",
- TargetKind: "ctrlplane.dev/network/v1",
- TargetVersion: "GoogleNetwork",
+ TargetKind: "GoogleNetwork",
+ TargetVersion: "ctrlplane.dev/network/v1",This ensures all providers use Kind for resource type and Version for API group/version.
📝 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.
| SourceKind: "AWSElasticKubernetesService", | |
| SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1", | |
| TargetKind: "AWSNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| // cmd/ctrlc/root/sync/aws/rds/rds.go | |
| … | |
| CreateResourceRelationshipRule( | |
| agent, | |
| ResourceRelationshipRule{ | |
| SourceKind: "AWSRelationalDatabaseService", | |
| SourceVersion: "ctrlplane.dev/database/v1", | |
| TargetKind: "AWSNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| }, | |
| ) | |
| … |
| SourceKind: "AWSElasticKubernetesService", | |
| SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1", | |
| TargetKind: "AWSNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| // cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go | |
| … | |
| CreateResourceRelationshipRule( | |
| agent, | |
| ResourceRelationshipRule{ | |
| SourceKind: "GoogleCloudSQL", | |
| SourceVersion: "ctrlplane.dev/database/v1", | |
| TargetKind: "GoogleNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| }, | |
| ) | |
| … |
Summary by CodeRabbit