kubectl-operator
kubectl-operator copied to clipboard
OLM sometimes creates two install plans for a subscription
I ran:
kubectl operator install etcd -w "default" -C
This seems to result in a successful installation, but there's an extra install plan in the namespace for etcd, which remains un-approved.
According to OLM maintainers, the duplicate install plan issue is a bug. OLM will auto delete all but the latest 5 install plans, so we could delete the duplicate install plan in kubectl operator
code, but it doesn't seem strictly necessary.
Update: I just attempted to reproduce this issue, and I noticed that kubectl operator
approved the "wrong" install plan. Looking at the kubectl operator
code, it appears as if it:
- Creates the subscription
- Waits for the subscription's
status.installPlanRef
to be set. - Fetches the install plan found in 2)
- Updates the install plan found in 2) by setting
spec.approved
totrue
.
Therefore, OLM is setting an install plan reference on the subscription and then (sometimes) immediately re-reconciling the subscription, creating another install plan, and then updating the install plan reference, rendering the first approved install plan inert. When kubectl operator
is fast enough (or OLM is slow enough), kubectl operator
is able to pick up the first install plan just before it becomes inert, eventually causing the install to timeout and fail.