Skip to content

Question: Primary to DR many-to-one & many-to-many relationships possible? #2159

@Huldula

Description

@Huldula

I have a usecase, where I need to create, update and delete Resources, depending on multiple primary resources.
Here is a little example:
My primary custom resource is UserGroup. Let's say I have 2 of those:

apiVersion: example
kind: UserGroup
metadata:
  name: read-group
spec:
  permissions:
    - "Read"
apiVersion: example
kind: UserGroup
metadata:
  name: write-group
spec:
  permissions:
    - "Write"

From this I want to generate User custom resources. If a User in both the read-group and the write-group, he should get both permissions:

apiVersion: example
kind: User
metadata:
  name: alice
spec:
  permissions:
    - "Read"
    - "Write"

Changes like updates and deletion on the UserGroup should also trigger updates on the User

I wanted to avoid using the KubernetesClient directly because just specifying a simple desired state like with AbstractDependentResource::desired seems to be less complicated.
Is something like this possible in java-operator-sdk?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions