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

Remove any existing finalizer #4512

Closed
vaikas opened this issue Nov 12, 2020 · 4 comments
Closed

Remove any existing finalizer #4512

vaikas opened this issue Nov 12, 2020 · 4 comments
Labels
area/channels kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@vaikas
Copy link
Contributor

vaikas commented Nov 12, 2020

Describe the bug
Prior to #4511 IMC would have finalizer. If this gets upgraded, then the IMC will not get removed. So, we should remove all the existing finalizers.

Expected behavior
Existing IMC after an upgrade to .20 will get properly deleted.

To Reproduce
Steps to reproduce the behavior.

Knative release version
0.20

Additional context
In 0.19, IMC dispatcher would set the finalizer so it would get removed. in #4511 we just deal with this in ReconcileKind, and hence after upgrading to this behaviour, any existing InMemoryChannels will have Finalizer set, but nothing that will clean it up. So, we should probably just remove those always in the Controller in case they are there. Need to test that they will be properly respected with genreconciler (nothing says they won't, but just need to verify this (for example, if it doesn't allow adding/removing additional finalizers)).

@vaikas vaikas added the kind/bug Categorizes issue or PR as related to a bug. label Nov 12, 2020
@grantr grantr added this to the v0.20.0 milestone Nov 16, 2020
@grantr grantr added area/channels priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Nov 16, 2020
@slinkydeveloper
Copy link
Contributor

@vaikas Is this still relevant? I see 0.20 as release

@lberk
Copy link
Member

lberk commented Mar 8, 2021

@vaikas is this issue still relevant? (v0.20 was released several weeks ago)

@antoineco
Copy link
Contributor

antoineco commented Mar 10, 2021

I noticed that yesterday. All in-memory channels created before 0.20 are un-deletable because they contain a finalizer that no controller acts upon.

We are already on 0.21 so we can probably consider the damage done and move on. Or maybe provide a clean up script outside the regular releases for folks who ran into this. For example:

#!/usr/bin/env bash

kubectl get inmemorychannels.messaging.knative.dev -A -o json \
    | jq -r '.items[] | select(
          .metadata.deletionTimestamp != null
      ) | @base64' \
    | while read -r imc; do
          echo "$imc" | base64 -d \
          | kubectl patch -f- --type=json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
      done

Or change the condition in jq's select to remove the finalizers of all in-memory channels, not only the ones that are in deletion limbo:

#!/usr/bin/env bash

kubectl get inmemorychannels.messaging.knative.dev -A -o json \
    | jq -r '.items[] | select(
          .metadata.finalizers != null
      ) | @base64' \
    | while read -r imc; do
          echo "$imc" | base64 -d \
          | kubectl patch -f- --type=json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
      done

(I use this @base64 / base64 -d dance to ensure each API object is serialized as a single word, otherwise while read wouldn't work)

@grantr
Copy link
Contributor

grantr commented Apr 12, 2021

0.20 is old enough now that I don't think it's worth trying to fix this automatically. I added a note pointing to @antoineco's comment in the 0.20.0, 0.20.1, 0.20.2, and 0.20.3 release notes:

Known Issues

@grantr grantr closed this as completed Apr 12, 2021
@grantr grantr unassigned grantr and vaikas Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/channels kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

5 participants