diff --git a/controllers/resources/authconfig.go b/controllers/resources/authconfig.go index 6ebad418..71d1f9d8 100644 --- a/controllers/resources/authconfig.go +++ b/controllers/resources/authconfig.go @@ -84,9 +84,10 @@ func (s *staticTemplateLoader) Load(ctx context.Context, authType AuthType, key } templateData := map[string]interface{}{ - "Namespace": key.Namespace, - "Audiences": getAuthAudience(), - "AuthorinoLabel": authKey + ": " + authVal, + "Namespace": key.Namespace, + "Audiences": getAuthAudience(), + "AuthorinoLabel": authKey + ": " + authVal, + "InferenceServiceName": key.Name, } template := authConfigTemplateAnonymous if authType == UserDefined { diff --git a/controllers/resources/template/authconfig_userdefined.yaml b/controllers/resources/template/authconfig_userdefined.yaml index 79a62cba..46634787 100644 --- a/controllers/resources/template/authconfig_userdefined.yaml +++ b/controllers/resources/template/authconfig_userdefined.yaml @@ -22,14 +22,14 @@ spec: verb: value: get group: - value: "" + value: "serving.kserve.io" resource: - value: services + value: inferenceservices namespace: value: {{ .Namespace }} subresource: value: "" name: - value: "" + value: "{{ .InferenceServiceName }}" user: selector: auth.identity.user.username \ No newline at end of file