Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions cmd/ctrlc/root/sync/google/gke/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,11 @@ var relationshipRules = []api.CreateResourceRelationshipRule{
Name: "Google Cloud Cluster Network",
DependencyType: api.ProvisionedIn,

SourceKind: "ctrlplane.dev/kubernetes/cluster/v1",
SourceVersion: "GoogleKubernetesEngine",
TargetKind: "ctrlplane.dev/network/v1",
TargetVersion: "GoogleNetwork",
SourceKind: "GoogleKubernetesEngine",
SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1",

TargetKind: "GoogleNetwork",
TargetVersion: "ctrlplane.dev/network/v1",

MetadataKeysMatch: []string{"google/project", "network/name"},
},
Expand Down
10 changes: 6 additions & 4 deletions internal/api/resource_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ func NewResourceProvider(client *ClientWithResponses, workspaceId string, name s
Name: provider.Name,
ID: provider.Id,
client: client,
workspaceId: workspaceId,
}, nil
}

type ResourceProvider struct {
ID string
Name string
client *ClientWithResponses
ID string
Name string
client *ClientWithResponses
workspaceId string
}

type AgentResource struct {
Expand Down Expand Up @@ -104,7 +106,7 @@ func (r *ResourceProvider) UpsertResource(ctx context.Context, resources []Agent

func (r *ResourceProvider) AddResourceRelationshipRule(ctx context.Context, rules []CreateResourceRelationshipRule) error {
for _, rule := range rules {
rule.WorkspaceId = r.ID
rule.WorkspaceId = r.workspaceId
resp, err := r.client.UpsertResourceRelationshipRuleWithResponse(ctx, rule)
if err != nil {
return err
Expand Down