-
Notifications
You must be signed in to change notification settings - Fork 12
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
Pod Annotator only sets the first container in the list and ignores init containers. #25
Comments
Thanks for bringing this up, this is by design.
|
This came up in a different PR review, comment: https://github.com/openshift/instaslice-operator/pull/141/files/b36341967d2a863d38d08993917af4d8ecc0aa75#r1792193024 |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
/remove-lifecycle stale |
The code below patches the containers of the first pod. There are two bugs and one question I see here:
An init container can have access to a GPU so one may not be able to get the MIG slice for the init container.
Pods can take a list of containers and this only edits the first container in the list.
Question: Ephemeral containers are also ignored but not sure if they need access to the MIG slice.
func (a *PodAnnotator) Handle(ctx context.Context, req admission.Request) admission.Response {
...
pod.Spec.Containers[0].EnvFrom = append(pod.Spec.Containers[0].EnvFrom, v1.EnvFromSource{
ConfigMapRef: &v1.ConfigMapEnvSource{
LocalObjectReference: v1.LocalObjectReference{Name: configMapName},
},
})
}
The text was updated successfully, but these errors were encountered: