operator-framework / operator-framework/java-operator-sdk

Automatically Delete Resource if Dependent Removed From Workflow

Open
#2,267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Java
Stars
944
Forks
242
Avg merge
1d 4h
Merged PRs (30d)
43

Description

If a dependent is removed from a workflow, the previously created resource represented by that dependent needs to be cleaned up. This can happen before the actual workflow is executed.
This could be done automatically before a workflow is executed, although it is not trivial in general. There are two problems:

  1. If a dependent is removed, on startup the informer related to its type might not be added anymore. So we would need to mark somewhere (maybe status or annotation?) the GVk-s of resources managed.

  2. If there are multiple resources of the same type in general it is not easy to identify which resource belongs to which dependent resource - without calling getSecondaryResource on the dependent. Since this cleanup would happen before the dependents are reconciled this is not doable without imposing additional requirements on implementation: for example, if the id of the resource is calculated based on the desired state, the desired state calculation might depend on other resources (which might not be reconciled now).
    Fortunately, this problem can be solved simply just by adding the name of the dependent as an annotation to the resource so it can be identified easily.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing workflow execution and the informer and dependent-resource lifecycle described in the issue. Determine how managed resource kinds and dependent names can be retained, then define completion as cleanup occurring before execution for removed dependents without confusing multiple resources of the same type.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kubernetes
Domain
infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.