Skip to content
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

Invalid parent references are challenging to implement status for #836

Closed
howardjohn opened this issue Aug 27, 2021 · 10 comments
Closed

Invalid parent references are challenging to implement status for #836

howardjohn opened this issue Aug 27, 2021 · 10 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@howardjohn
Copy link
Contributor

spec:
  parentRefs:
  - kind: Gaway
    name: foo

Lets say I have a route like ^. I made a typo on the kind. In this case, the route will be totally ineffective (assuming no controller implements a Gaway type). However, there is no way to actually report this to a user. No controller can write "Unknown kind Gaway" or equivalent, since they don't know if its truely unknown, or just not known to them, but is known to another controller.

The same also applies to name/namespace not matching.

Essentially, we need a valid parentRef in order to report status on a parent, which makes it impossible to report invalid parentRefs.

One option that could work is to suggest that controllers report invalid parentRefs IFF there is not already another controller that wrote the status for that parent. This means for an invalid ref, the first controller will "win" and report an error. If that reference becomes valid later (say another controller understands it) it will overwrite it with a valid status; the old "winner" will now stop reporting any errors.

@robscott
Copy link
Member

We have the same problem if a Gateway specifies an invalid/missing GatewayClass. There are essentially no controllers that can or should be responsible for setting an error message on that Gateway. I think the same applies to an invalid parentRef. We have no way of knowing whether a resource has some kind of special meaning to a given implementation and therefore it becomes difficult or impossible to confidently invalidate a parentRef, let alone determine which controller should be responsible for doing that. I think the best signal we can give is simply the lack of status indicating that a resource has been attached/accepted.

@robscott
Copy link
Member

In #839 I added a note to Route status describing this limitation.

@jpeach
Copy link
Contributor

jpeach commented Aug 29, 2021

I expect that the specific case of an invalid kind could be caught by the admission validation. I don't think that we can require the referent object to actually exist at this time though maybe the validation can resolve the reference and set an initial status condition.

@howardjohn
Copy link
Contributor Author

Can a mutating webhook actually set status?

We have the same problem if a Gateway specifies an invalid/missing GatewayClass

The same solution could actually apply, that controllers should set the "unknown GatewayClass" IFF no other controller has set it. That way a controller will never turn a positive condition to a negative, but can turn negative to positive (and thus "take ownership" of the field)

@youngnick
Copy link
Contributor

Yeah, I think it should be every controller's responsibility to set the status to "looks like there's a really bad problem" unless they see something else has done that previously.

So yes, a race, but a race that should solve itself quickly.

@jpeach
Copy link
Contributor

jpeach commented Aug 30, 2021

Can a mutating webhook actually set status?

We have the same problem if a Gateway specifies an invalid/missing GatewayClass

We default the gateway status so it's clear that is is not getting reconciled.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 28, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 28, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants