Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Test route url fix #66
Test route url fix #66
Changes from all commits
d0848c9
f666e4a
418ce99
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 order to be sure that the operator won't restart processing the custom resource immediately, you could also return the following:
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.
Here I'm not able to return
reconcile.Result
without modifying the signature. It seems to be a helper class and return here seems not good, at least there is no such any method in this class.Do you think it is OK to send
reconcile.Result
back thoughk8s_helper.go#GetEndpointTlsCrt
->create.go#CreateTLSSecret
->che_controller.go#Reconcile
?Or the following fragment in che_controller would be good enough?
But it would mean that we wait one second on any error, like failed to get namespace, failed to create route, failed to fetch host...
Then why we do not wait 1 second in other places like: when we failed to create service account https://github.com/eclipse/che-operator/blob/9682f3448fe240c216aa22d9d3f56cc056b01494/pkg/controller/che/che_controller.go#L315-L317
BTW Seems that even with
![Screenshot_20190905_104935](https://user-images.githubusercontent.com/5887312/64322913-1d198300-cfcc-11e9-8ad4-b7a68cff248d.png)
return reconcile.Result{}, err
there is ~ 1 second betweenk8s_helper.go#GetEndpointTlsCrt
invocationsthe first one - is the first invocation
2nd and 3rd are the second invocation.
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.
Oh, yes, I didn't pay attention to the fact it was inside a utility function.
You might simply add a
retryLater
boolean return value, and use it in theche_controller
reconcile function.Well the existing logic in the controller (that was already there when I started on it) seems to be the following:
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.
Do you think that we should retry if quite unexpected exception occurred like
failed to create route
?It's unexpected by maybe k8s/openshift API was temporary unavailable...
WDYT?
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 think that if the
CreateTLSSecret
function returnscontinueLater
withtrue
, then the callingreconcile
method should returnreconcile.Result{Requeue: true, RequeueAfter: time.Second * 1}, err
else it should returnnil, err
if an unexpected error occured.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.
yeah, I understand it, let me rephrase my question:
CreateTLSSecret may returns error in different situations:
Which of this errors you consider as unexpected and which expected (like 4 about route) ?
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.
To me you would only use
continueLater=true
in situation 4. We know that in some cases the host can take some time to be added to the route object. It's expected.Possibly 5 could also be expected (and return
continueLater=true
, since sometimes the route may take some time to be setup.But main point is the 4 IMO
Does it seem consistent to you ?
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 believe that this PR brings some fix and does not do code base worse.
Your proposed solution totally makes sense but it's more about refactoring the current architecture but not about fixing the issue I initially tried to use.
Sorry, but I'm not able to invest now in operator architecture.
@davidfestal If you agree that this PR is OK to merge - please approve.
If you think that it brings more issues than solves - feel free to close it.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.