-
Notifications
You must be signed in to change notification settings - Fork 72
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
Service binding supporting deployment config #1077
Conversation
WIP. FYI @rkpattnaik780 |
92b9c2e
to
fe82a82
Compare
@craicoverflow just review needed. Verification not possible - SBO operator seems to be broken |
@@ -26,7 +26,7 @@ require ( | |||
github.com/redhat-developer/app-services-sdk-go/kafkamgmt v0.4.0 | |||
github.com/redhat-developer/app-services-sdk-go/registryinstance v0.3.1 | |||
github.com/redhat-developer/app-services-sdk-go/registrymgmt v0.2.0 | |||
github.com/redhat-developer/service-binding-operator v0.8.0 | |||
github.com/redhat-developer/service-binding-operator v0.9.0 |
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.
Wasn't v0.10.0 announced? Maybe that could resolve it.
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.
0.10.0 is actually the version of the cluster that breaks things.
0.10.0 also doesn't seem to compile redhat-developer/service-binding-operator#1022
I have verified this for deployment config. So service binding is created and command works.
but we cannot verify this end to end. I think we should merge this knowing that command works as it should
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.
LGTM
pkg/cluster/serviceBinding.go
Outdated
} | ||
logger.Debug("Service binding Operator not available. Will use SDK option for binding") | ||
return useSDKForBinding(clients, sb) | ||
return localizer.MustLocalizeError("cluster.serviceBinding.operatorMissing", localize.NewEntry("Error", err)) |
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.
return localizer.MustLocalizeError("cluster.serviceBinding.operatorMissing", localize.NewEntry("Error", err)) | |
return localizer.MustLocalizeError("cluster.serviceBinding.operatorMissing", localize.NewEntry("Error", err)) |
Passing in the err
object to localizer wil convert it to a string, and you cannot do any casting/type checking of the error from thereon in. It's recommended to preserve the error object.
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 discussed that yesteday that we going to map errors specifically for providing more reliable info.
So we should probably:
- Log error that we recognize
- Return error to be printed again with more generic/non i18n content
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.
Yes - in the commands it makes sense to map errors and preserving the error object does not matter too much. However in an SDK scenario (like this one) I think it is important to preserve it because the place it is being used is able act different based on the error type.
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.
In this case error will be cryptic - 404 kafka API doesn't exist or missing auth token. Do you suggest to return original error only?
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 it can be wrapped like this:
return fmt.Errorf("your reason: %w", err)
%w
means wrap the error.
c1b0ab4
to
07f3350
Compare
@rkpattnaik780 That is mostly because of logic - it lets you to select kafka that you do not have on the cluster. |
31dc3a5
to
20b3472
Compare
d80a37a
to
60beeae
Compare
Blocked by: My quess is that we going to merge and release it so we can rebase and continue refactoring it for multiservice architecture |
What this does
We are adding deploymentConfig support by extra flag.
Why flag instead of showing both?
Deployment config is typically problematic with binding (extra rollouts are needed and we cannot make sure that binding will be valid). We needed to provide extra documentation etc. to support that - adding it by default will cause confusion and problems.
It will also break our existing guides :/
Notes
This change doesn't introduce any multiservice aritecture.
This is going to be done in separate feature branch done by @rkpattnaik780
I have prepared layer for that refactoring but we need to work on top of the changes that Rama has right now.
Verification