Move revision condition manipulation to _types.go#1118
Move revision condition manipulation to _types.go#1118google-prow-robot merged 5 commits intoknative:masterfrom
Conversation
|
Oh, this also makes |
|
The following is the coverage report on pkg/. Say
*TestCoverage feature is being tested, do not rely on any info here yet |
|
The following is the coverage report on pkg/. Say
*TestCoverage feature is being tested, do not rely on any info here yet |
|
/assign @jonjohnsonjr |
|
/assign @tcnghia Jon's travelling. |
| } | ||
| // Don't modify the informer's copy. | ||
| rev = rev.DeepCopy() | ||
| rev.Status.InitializeConditions() |
There was a problem hiding this comment.
does this set all existing conditions on the Status to Unknown? are there cases where we would want to retain existing conditions?
There was a problem hiding this comment.
This only populates missing Conditions.
| // TODO(mattmoor): Use a method on the Build type. | ||
| func isBuildDone(rev *v1alpha1.Revision) (done, failed bool) { | ||
| if rev.Spec.BuildName == "" { | ||
| return true, false |
There was a problem hiding this comment.
personally I'd find it more readable to do
done,failed = true, false
return
but the function is small enough so you don't need to do that if you don't want to.
There was a problem hiding this comment.
I'll tweak this a bit further
| if getIsServiceReady(endpoint) { | ||
| logger.Infof("Endpoint %q is ready", eName) | ||
| if err := c.markRevisionReady(ctx, rev); err != nil { | ||
| rev.Status.MarkResourcesAvailable() |
There was a problem hiding this comment.
looks like these two always go together? I wonder if they can be the same condition?
There was a problem hiding this comment.
Yeah, I was struggling with this myself. I opened #1137 for this discussion.
This is the Revision equivalent of #1113 This contains two other unrelated changes: 1. Condense the object construction in `revision_test.go` 1. Reorder the `helloworld` yaml to create the configuration first. The reason for the second "unrelated" change is that I was seeing the route controller marking the Route as "AllTrafficAssigned = False" because the configuration wasn't created yet.
Eliding conditions can come later, it's a premature optimization, and I'm not sure we're handling conditions well enough to do it reliably yet.
af209cd to
c27e365
Compare
|
The following is the coverage report on pkg/. Say
*TestCoverage feature is being tested, do not rely on any info here yet |
|
thanks a lot for doing this refactoring. /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattmoor, tcnghia The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is the Revision equivalent of #1113
This contains two other unrelated changes:
revision_test.gohelloworldyaml to create the configuration first.The reason for the second "unrelated" change is that I was seeing the route controller marking the Route as "AllTrafficAssigned = False" because the configuration wasn't created yet.