Skip to content

Commit

Permalink
expose raw resourceRefs
Browse files Browse the repository at this point in the history
Signed-off-by: Bulat Shakirzyanov <83289+avalanche123@users.noreply.github.com>
  • Loading branch information
avalanche123 committed Dec 12, 2023
1 parent 95361ad commit 5a9bf4c
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 0 deletions.
152 changes: 152 additions & 0 deletions internal/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions internal/graph/resolvers/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ func (r *compositeResourceSpec) Resources(ctx context.Context, obj *model.Compos
return *out, nil
}

func (r *compositeResourceSpec) ResourceRefs(ctx context.Context, obj *model.CompositeResourceSpec) ([]model.ObjectReference, error) {
resourceRefs := make([]model.ObjectReference, 0, len(obj.ResourceReferences))
for i := range obj.ResourceReferences {
resourceRefs = append(resourceRefs, *model.GetObjectReference(&obj.ResourceReferences[i]))
}
return resourceRefs, nil
}

func (r *compositeResourceSpec) ConnectionSecret(ctx context.Context, obj *model.CompositeResourceSpec) (*model.Secret, error) {
if obj.WriteConnectionSecretToReference == nil {
return nil, nil
Expand Down
5 changes: 5 additions & 0 deletions schema/composite.gql
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ type CompositeResourceSpec {
"""
connectionSecret: Secret @goField(forceResolver: true)

"""
The `ObjectReference`s for the resources composed by this composite resources.
"""
resourceRefs: [ObjectReference!]!

"""
The resources of which this composite resource is composed.
"""
Expand Down

0 comments on commit 5a9bf4c

Please sign in to comment.