Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Validating Webhook accountquotas.config.kiosk.sh #34

Closed
FabianKramm opened this issue Feb 14, 2020 · 4 comments
Closed

Validating Webhook accountquotas.config.kiosk.sh #34

FabianKramm opened this issue Feb 14, 2020 · 4 comments

Comments

@FabianKramm
Copy link
Member

FabianKramm commented Feb 14, 2020

AccountQuota needs a validating webhook to check for the following things:

  • Create/Update:
    • Ensure valid resource list (currently you can specify invalid resources), basically do the same checks as ResourceQuota is doing
@rahulchheda
Copy link
Contributor

Is this issue still available? @FabianKramm ?

@FabianKramm
Copy link
Member Author

@rahulchheda yes this is still available, currently the check if the specified resources are valid is still missing, would be great if you would open a pr for this!

@rahulchheda
Copy link
Contributor

@FabianKramm , can you add context to this issue also, so I can take this up aswell?

@FabianKramm
Copy link
Member Author

FabianKramm commented Jun 4, 2020

@rahulchheda sure, in essence this issue is similar to #2, however this time we want to validate the AccountQuota field spec.quota. We want to do the exact same checks as kubernetes does for ResourceQuota spec, hence I think the best way is to reuse most of the validation kubernetes does for this type (corev1.ResourceQuotaSpec) if possible, you can take a look how kubernetes does it here: https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/core/validation/validation.go#L5339 .

I think the best idea would be to copy over the relevant code from them (because we do not want github.com/kubernetes/kubernetes as a dependency, see kubernetes/kubernetes#80339 (comment) for more details) and change their internal *core.ResourceQuotaSpec type to the one we use *corev1.ResourceQuotaSpec.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants