Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/ctrlc/root/sync/aws/eks/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ var relationshipRules = []api.CreateResourceRelationshipRule{
Name: "AWS Cluster Network",
DependencyType: api.ProvisionedIn,

SourceKind: "ctrlplane.dev/kubernetes/cluster/v1",
SourceVersion: "AWSElasticKubernetesService",
TargetKind: "ctrlplane.dev/network/v1",
TargetVersion: "AWSNetwork",
SourceKind: "AWSElasticKubernetesService",
SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1",
TargetKind: "AWSNetwork",
TargetVersion: "ctrlplane.dev/network/v1",
Comment on lines +313 to +316
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 go

Length 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.

Suggested change
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",
},
)
Suggested change
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",
},
)


MetadataKeysMatch: []string{"aws/region", "network/name"},
},
Expand Down