-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed generating sync_key_template path #249
Conversation
We should do this when we make body in the transaction, otherwise we can't ensure consistency of data. |
e7408a8
to
e6c9f7b
Compare
Could you make your commit message descriptive? |
During state update the path in etcd was chosen based on schema.url prefix instead of sync_key_template path. If path in etcd (when it's based on sync_key_template) doesn't have the same prefix as resource url in api, then gohan doesn't watch state updates for that resource. The same happens in the case of monitoring update. |
I got it. Could you put the statement in the commit message? |
e6c9f7b
to
d942185
Compare
@@ -393,7 +393,8 @@ func (schema *Schema) GetResourceIdFromPath(schemaPath string) string { | |||
} | |||
} | |||
|
|||
func GetSchemaByPath(path string) *Schema { | |||
//Get schema by resource path (from API) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should start with the function name[1]. golint
will likely complain.
[1] https://golang.org/doc/effective_go.html#commentary ("doc comments")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I fixed comments.
Commit message looks malformatted. Please check https://git-scm.com/book/ch5-2.html |
d942185
to
ba68bc5
Compare
7ae1254
to
59004fd
Compare
59004fd
to
879a5b4
Compare
Hi @nati , what is the status of this PR? Can we merge it? |
@marcin-ptaszynski let me review again. Does this look good for you? |
Commit messege need to be updated. During state update the path in etcd was chosen based on schema.url prefix instead of sync_key_template path. If path in etcd (when it's based on sync_key_template) doesn't have the same prefix as resource url in api, then gohan doesn't watch state updates for that resource. The same happens in the case of monitoring update. |
879a5b4
to
168837c
Compare
I changed commit message and rebased to current version of master branch. |
schemaByPath = schema | ||
break | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if {
Fixed looking for path in state and monitoring update Fixed not getting resouce url from db Added tests for schema urls Fixes that path in etcd monitoring and state update should be based on sync_key_template Fixed some lint errors Fix in test Refactoring in GetSchema functions During state update the path in etcd was chosen based on schema.url prefix instead of sync_key_template path. If path in etcd (when it's based on sync_key_template) doesn't have the same prefix as resource url in api, then gohan doesn't watch state updates for that resource. The same happens in the case of monitoring update. In this commit, we apply sync_key_template for sync path.
168837c
to
65adff9
Compare
ok thanks! |
resource.Get("body") sometimes doesn't have all necessary fields to put them into generated path, so the data should be fetched from db.