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

[Story] Look into admission webhook as alternative to ClusterCryostat #583

Closed
Tracked by #1489
ebaron opened this issue May 9, 2023 · 3 comments
Closed
Tracked by #1489
Assignees
Labels
breaking change This change (potentially) breaks API compatibility and requires corresponding changes elsewhere feat New feature or request

Comments

@ebaron
Copy link
Member

ebaron commented May 9, 2023

It would be nice for Cryostat 3.0 if we could combine the Cryostat and ClusterCryostat APIs. One possibility is keeping the namespaced Cryostat CRD and using a validating admission webhook:
https://sdk.operatorframework.io/docs/building-operators/golang/webhook/#1-validating-admission-webhook

We could add a targetNamespaces field to the Cryostat instance. If possible, the webhook would use the user info the AdmissionRequest to do an authorization check against the target namespaces (e.g. can user X create a Cryostat in namespaces Y, Z).

There would still be potential for role binding name conflicts to account for as we already deal with between the ClusterCryostat and Cryostat APIs.

@ebaron ebaron added feat New feature or request breaking change This change (potentially) breaks API compatibility and requires corresponding changes elsewhere labels May 9, 2023
@ebaron ebaron changed the title Look into admission webhook as alternative to ClusterCryostat [Story] Look into admission webhook as alternative to ClusterCryostat May 23, 2023
@ebaron
Copy link
Member Author

ebaron commented Nov 16, 2023

Consider also using the webhook to check for any potential naming conflicts across target namespaces.

@ebaron
Copy link
Member Author

ebaron commented Nov 16, 2023

Another possibility to avoid name conflicts is to use GenerateName on some initial resource, maybe the lock ConfigMap, and store the resulting name in the CR. Then use that generated name consistently for all other objects owned by that CR.

@ebaron
Copy link
Member Author

ebaron commented Nov 17, 2023

Yet another possibility is to not rely on the names of objects but to use labels or annotations to indicate which CR owns them, and then use a List instead of Get operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This change (potentially) breaks API compatibility and requires corresponding changes elsewhere feat New feature or request
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant