Skip to content

Commit

Permalink
feat(backend): Include namespace in pipeline API response. Part of ku…
Browse files Browse the repository at this point in the history
  • Loading branch information
elikatsis committed Oct 18, 2022
1 parent 8df22db commit 15096fc
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions backend/src/apiserver/server/api_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,27 @@ func ToApiPipeline(pipeline *model.Pipeline) *api.Pipeline {
}
}

var resourceRefs []*api.ResourceReference
if len(pipeline.Namespace) > 0 {
resourceRefs = []*api.ResourceReference{
{
Key: &api.ResourceKey{
Type: api.ResourceType_NAMESPACE,
Id: pipeline.Namespace,
},
Relationship: api.Relationship_OWNER,
},
}
}

return &api.Pipeline{
Id: pipeline.UUID,
CreatedAt: &timestamp.Timestamp{Seconds: pipeline.CreatedAtInSec},
Name: pipeline.Name,
Description: pipeline.Description,
Parameters: params,
DefaultVersion: defaultVersion,
Id: pipeline.UUID,
CreatedAt: &timestamp.Timestamp{Seconds: pipeline.CreatedAtInSec},
Name: pipeline.Name,
Description: pipeline.Description,
Parameters: params,
DefaultVersion: defaultVersion,
ResourceReferences: resourceRefs,
}
}

Expand Down

0 comments on commit 15096fc

Please sign in to comment.