-
Notifications
You must be signed in to change notification settings - Fork 52
Validate create asset response. #1981
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
Conversation
return r.validateAssetResponse(responseJSON, taxonomyFile, datasetID) | ||
} | ||
|
||
func (r *FybrikApplicationReconciler) ValidateCreateAssetResponse(response *datacatalog.CreateAssetResponse, |
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 functions are pretty much identical, we don't need both. Just pass interface{} as the argument.
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.
@shlomitk1 ok, Thanks
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.
No, the function will already get the right taxonomy, as you implemented. I suggest merely to change the function signature and then you'll be able to call the same function with different taxonomy file.
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.
@shlomitk1 Thanks please take a look at the changes. (I overwrite the previous commits) Thanks
@@ -21,7 +21,7 @@ import ( | |||
// - an error if happened | |||
// - the new asset identifier | |||
func (r *FybrikApplicationReconciler) RegisterAsset(assetID string, catalogID string, | |||
info *fapp.DatasetDetails, input *fapp.FybrikApplication) (string, error) { | |||
info *fapp.DatasetDetails, input *fapp.FybrikApplication) (*datacatalog.CreateAssetResponse, error) { |
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.
Why are you changing the signature? The original behavior was to register the asset and return the registered asset id or an error. Why not do the validation here and return the same after validation.
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.
I'll do that Thanks
if err != nil { | ||
applicationContext.Log.Error().Err(err).Msg("failed to validate the catalog connector " + | ||
"response when creating new asset") | ||
setReadyCondition(applicationContext, assetID) |
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.
We could not properly register the asset. Why is it ready?
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.
I'll fix that thanks
Signed-off-by: Revital Sur <eres@il.ibm.com>
This PR adds a missing taxonomy verification of the create asset response.