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 committed Oct 18, 2022
1 parent 8df22db commit a9633b1
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 a9633b1

Please sign in to comment.