When using finalizers, delete protection via annotation is ignored

オープン
#2,918 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go, kubernetes, postgresql
領域
databases, devops

調査の方向性

pkg/controller/postgresql.go の 334 行目付近にある DeleteTimestamp の処理から始め、次に EventDelete がどのようにキューに追加されるか、またアノテーションベースの削除保護がどこでチェックされるかを追跡します。既存の controller テストがあれば、それを使って finalizer のパスとイベントフローを確認します。finalizer が使用されている場合に、リソースが削除される前に削除保護が適用されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

question
  • Which image of the operator are you using? e.g. ghcr.io/zalando/postgres-operator:v1.13.0
    ghcr.io/zalando/postgres-operator:v1.14.0
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? [AWS K8s | GCP ... | Bare Metal K8s]
    GCP
  • Are you running Postgres Operator in production? [yes | no]
    Not yet
  • Type of issue? [Bug report, question, feature request, etc.]
    Bug report

When using finalizers, the operator deletes all resources before the EventDelete event is received.
The delete protection check occurs when the EventDelete event is added to the queue, but by then all the resources have been deleted.

When the operator notices the DeleteTimestamp is set here, it proceeds to delete the cluster right away.
It might be better at that point to simply queue an EventDelete event to handle the deletion the normal way (assuming I've understood the internal event system correctly).

主要言語
Go
スター
5.3k
フォーク
1.1k
平均マージ
3日 17時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zalando/postgres-operator のほかの issue

zalando/postgres-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。