diff --git a/pkg/controller/inferenceservice/resources/credentials/service_account_credentials.go b/pkg/controller/inferenceservice/resources/credentials/service_account_credentials.go index 0726f3baf7a..fa56d15921c 100644 --- a/pkg/controller/inferenceservice/resources/credentials/service_account_credentials.go +++ b/pkg/controller/inferenceservice/resources/credentials/service_account_credentials.go @@ -80,7 +80,8 @@ func (c *CredentialBuilder) CreateSecretVolumeAndEnv(namespace string, serviceAc err := c.client.Get(context.TODO(), types.NamespacedName{Name: serviceAccountName, Namespace: namespace}, serviceAccount) if err != nil { - log.Error(err, "Failed to find service account", "ServiceAccountName", serviceAccountName) + log.Error(err, "Failed to find service account", "ServiceAccountName", serviceAccountName, + "Namespace", namespace) return nil } diff --git a/pkg/webhook/admission/pod/mutator.go b/pkg/webhook/admission/pod/mutator.go index 2622be96989..7fbae23facc 100644 --- a/pkg/webhook/admission/pod/mutator.go +++ b/pkg/webhook/admission/pod/mutator.go @@ -54,6 +54,9 @@ func (mutator *Mutator) Handle(ctx context.Context, req types.Request) types.Res return admission.ErrorResponse(http.StatusInternalServerError, err) } + // For some reason pod namespace is always empty when coming to pod mutator, need to set from admission request + pod.Namespace = req.AdmissionRequest.Namespace + if err := mutator.mutate(pod, configMap); err != nil { return admission.ErrorResponse(http.StatusInternalServerError, err) } diff --git a/pkg/webhook/admission/pod/storage_initializer_injector.go b/pkg/webhook/admission/pod/storage_initializer_injector.go index e21eb29bc6d..c403d3a5587 100644 --- a/pkg/webhook/admission/pod/storage_initializer_injector.go +++ b/pkg/webhook/admission/pod/storage_initializer_injector.go @@ -147,7 +147,6 @@ func (mi *StorageInitializerInjector) InjectStorageInitializer(pod *v1.Pod) erro ReadOnly: true, } userContainer.VolumeMounts = append(userContainer.VolumeMounts, sharedVolumeReadMount) - // Change the CustomSpecStorageUri env variable value to the default model path if present for index, envVar := range userContainer.Env { if envVar.Name == constants.CustomSpecStorageUriEnvVarKey && envVar.Value != "" {