Skip to content

mark revision Ready status true by looking for the services endpoints… - #104

Merged
vaikas merged 4 commits into
knative:masterfrom
vaikas:revisiontemplatestatus
Feb 8, 2018
Merged

vaikas merged 4 commits into
knative:masterfrom
vaikas:revisiontemplatestatus

Conversation

@vaikas

@vaikas vaikas commented Feb 8, 2018

Copy link
Copy Markdown
Contributor

… to have ready pods.

@vaikas
vaikas requested a review from mattmoor February 8, 2018 01:20
@vaikas vaikas added the WIP label Feb 8, 2018
Comment thread pkg/apis/ela/v1alpha1/revision_types.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd even drop Revision from the name.

Comment thread pkg/controller/revision/controller.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another approach to consider here would be looking at the OwnerRef like this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you called this: LookupServiceOwner or something, it could subsume the lookup below?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since we already create the label and I can use it, for this PR I'd like to just use that. I've added a method and a TODO. Ok with that?

Comment thread pkg/controller/revision/controller.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isn't this: r.Is[Revision]Ready()?

Comment thread pkg/controller/revision/controller.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

u.Is[Revision]Ready?

Comment thread pkg/controller/revision/controller.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This stuff needs tests.

Comment thread pkg/apis/ela/v1alpha1/revision_types.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should probably add tests for this stuff.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you even using any of this stuff in this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll pull these changes into a separate PR.

@vaikas

vaikas commented Feb 8, 2018

Copy link
Copy Markdown
Contributor Author

Yes on tests and some cleanup (hence the WIP label), just curious about high level doing it this way? I'm just curious if this approach seems like what we want to do? I'll change RevisionTemplate next to watch for Revision.Status, etc. So wanted to get a yay/nay before sending a bigger PR :)

@mattmoor

mattmoor commented Feb 8, 2018

Copy link
Copy Markdown
Contributor

You and your labels :) I put a big fat [WIP] in my title, so I definitely never see the label. Sorry, I'll try and adjust.

I think I'm generally fine with this assuming my working assumption holds, which is that if/when a Container specifies a readiness condition that it won't show up in the Endpoint until that's passed?

@vaikas

vaikas commented Feb 8, 2018

Copy link
Copy Markdown
Contributor Author

Yes, that's right:
From:
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#when-should-i-use-liveness-or-readiness-probes

readinessProbe: Indicates whether the Container is ready to service requests. If the readiness probe fails, the endpoints controller removes the Pod’s IP address from the endpoints of all Services that match the Pod. The default state of readiness before the initial delay is Failure. If a Container does not provide a readiness probe, the default state is Success

@vaikas

vaikas commented Feb 8, 2018

Copy link
Copy Markdown
Contributor Author

No worries, I can also adjust :)

@vaikas
vaikas force-pushed the revisiontemplatestatus branch from 38444df to b7c9ddd Compare February 8, 2018 04:30

@vaikas vaikas left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, PTAL.

Comment thread pkg/apis/ela/v1alpha1/revision_types.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread pkg/controller/revision/controller.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since we already create the label and I can use it, for this PR I'd like to just use that. I've added a method and a TODO. Ok with that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll pull these changes into a separate PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Delete?

@vaikas
vaikas merged commit 73efa8c into knative:master Feb 8, 2018
@vaikas
vaikas deleted the revisiontemplatestatus branch February 8, 2018 20:43
tcnghia pushed a commit to tcnghia/serving that referenced this pull request Jun 8, 2020
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign n3wscott shashwathi tanzeeb
/cc n3wscott shashwathi tanzeeb
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