Skip to content

Fix instance start API#1102

Merged
krhubert merged 14 commits intodevfrom
fix/instance
Jun 25, 2019
Merged

Fix instance start API#1102
krhubert merged 14 commits intodevfrom
fix/instance

Conversation

@NicolasMahe
Copy link
Copy Markdown
Member

Based on #1097

# Conflicts:
#	sdk/instance/helpers.go
Comment thread sdk/instance/instance.go Outdated
Comment thread server/grpc/api/mapping.go Outdated
// FromProtoService converts a the protobuf definition to the internal service struct
// TODO: should not be public. Need to move server/grpc/service.go to server/grpc/api/service.go
func FromProtoService(s *definition.Service) (*service.Service, error) {
if s == nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not check for nil, as it only hides some real issue with nil pointers. It should just do conversion without returning an error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should exist somewhere. I guess it could be move in the service.Create api function to keep the mapping simple 👍

Comment thread server/grpc/api/mapping.go Outdated
@@ -175,7 +182,7 @@ func toProtoParameters(params []*service.Parameter) []*definition.Parameter {

func toProtoConfiguration(configuration *service.Dependency) *definition.Configuration {
if configuration == nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here I guess, it shouldn't' check for nil, as this function is for mapping, not nic catching :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer, this have to be managed somewhere but i agree that it's not the best place here.

Comment thread server/grpc/api/mapping.go
@krhubert krhubert merged commit f7c63a4 into dev Jun 25, 2019
@antho1404 antho1404 deleted the fix/instance branch June 25, 2019 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants