Skip to content

Commit

Permalink
feat(backend): Include namespace in Pipeline API model. Part of #4197 (
Browse files Browse the repository at this point in the history
  • Loading branch information
elikatsis authored Oct 26, 2022
1 parent 5b75d75 commit 7c114a0
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 7c114a0

Please sign in to comment.