Skip to content

Commit

Permalink
Added VO info to Knative pods
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Nov 28, 2023
1 parent b7a4106 commit a7cbedd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/backends/knative.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ func (kn *KnativeBackend) createKNServiceDefinition(service *types.Service) (*kn
// https://knative.dev/docs/serving/services/private-services/
service.Labels[types.KnativeVisibilityLabel] = types.KnativeClusterLocalValue

// Add to the service labels the user VO for accounting on k8s pods
if service.VO != "" {
for _, vo := range kn.config.OIDCGroups {
if vo == service.VO {
Expand Down Expand Up @@ -324,6 +325,11 @@ func (kn *KnativeBackend) createKNServiceDefinition(service *types.Service) (*kn
},
}

// Add to the service labels the user VO for accounting on knative pods
if service.Labels["vo"] != "" {
knSvc.Spec.ConfigurationSpec.Template.ObjectMeta.Labels["vo"] = service.Labels["vo"]
}

if service.EnableSGX {
knSvc.Spec.ConfigurationSpec.Template.ObjectMeta.Annotations["kubernetes.podspec-securitycontext"] = "enabled"
knSvc.Spec.ConfigurationSpec.Template.ObjectMeta.Annotations["kubernetes.containerspec-addcapabilities"] = "enabled"
Expand Down

0 comments on commit a7cbedd

Please sign in to comment.