-
Notifications
You must be signed in to change notification settings - Fork 40k
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
REST api - can a pod without containers be created? #4932
Comments
What is the reason to create pod without specifiing image / creating container? Please provide a use case when such functionality is necessry. |
@bronislav - to me it's not necessary. However if it's not supported, a validation should prevent it not to allow corrupted entities. And if it is supported, it will be good to understand why. |
Yes, it should be allowed, and I'm pretty sure it used to work. Could you please post your object schema here or somewhere? |
@bgrant0607 what do you mean by object schema? an example json of such pod or something broader? |
@dchen1107 @thockin I'm fine with banning this for now. The use cases where it would be useful (e.g., reserving resources, staging deployment, prefetching images, ...) aren't currently well supported. When we add the features that could take advantage of this (e.g., pod-level resources, additional of containers during update, container volumes, pod/volume init hooks), then we can make it legal again at that point. |
@bgrant0607 in that case, a clear error message coming from REST would be in place when a pod with no containers is recieved by the server :) |
I'll look into this. @bgrant0607 AFAIU we want to return meaningful error if user specifies pod with no containers. Is my understanding correct? |
@fgrzadkowski Correct. We should do it in validateContainers: |
cc @mfojtik |
@bgrant0607, should we document this somewhere (e.g. api/v1betaX/types.go?). Validation is not versioned, so any change would apply to all existing APIs. |
Yes, it should be documented, in the field descriptions, such as: |
I'll send a PR for this. |
cc @zeari |
I tried to create a pod without containers to see if it's supported or not. (does a pod without containers have a meaning in k8s?)
I was getting "conflict 409 already exists" error although I used a new pod with a new name/id, so it's not clear whether it's supported or not, and whether this error is a mistake (409 instead of 400)
The text was updated successfully, but these errors were encountered: