8000 Validate create asset response. by revit13 · Pull Request #1981 · fybrik/fybrik · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 2 commits into from
Feb 20, 2023
Merged

Validate create asset response. #1981

merged 2 commits into from
Feb 20, 2023

Conversation

revit13
Copy link
Collaborator
@revit13 revit13 commented Feb 20, 2023

This PR adds a missing taxonomy verification of the create asset response.

return r.validateAssetResponse(responseJSON, taxonomyFile, datasetID)
}

func (r *FybrikApplicationReconciler) ValidateCreateAssetResponse(response *datacatalog.CreateAssetResponse,
Copy link
Contributor

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.

Copy link
Collaborator Author
@revit13 revit13 Feb 20, 2023

Choose a reason for hiding this comment

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

@shlomitk1 ok, Thanks

Copy link
Contributor

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.

Copy link
Collaborator Author

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) {
Copy link
Contributor

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.

Copy link
Collaborator Author
@revit13 revit13 Feb 20, 2023

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)
Copy link
Contributor

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?

Copy link
Collaborator Author

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>
@shlomitk1 shlomitk1 merged commit 9fbe482 into fybrik:master Feb 20, 2023
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.

2 participants
0