Skip to content

Commit

Permalink
feat(backend): Include namespace in Pipeline API model. Part of kubef…
Browse files Browse the repository at this point in the history
  • Loading branch information
elikatsis authored and jlyaoyuli committed Jan 5, 2023
1 parent 3668c3f commit 6d8458b
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 6d8458b

Please sign in to comment.