Skip to content

Commit

Permalink
Changes in knative definition
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Nov 24, 2023
1 parent 4054087 commit f6839a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions pkg/backends/knative.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ func (kn *KnativeBackend) CreateService(service types.Service) error {
return err
}

if service.VO != "" {
for _, vo := range kn.config.OIDCGroups {
if vo == service.VO {
service.Labels["vo"] = service.VO
}
}
}

// Create the Knative service definition
knSvc, err := kn.createKNServiceDefinition(&service)
if err != nil {
Expand Down Expand Up @@ -286,6 +278,14 @@ func (kn *KnativeBackend) createKNServiceDefinition(service *types.Service) (*kn
// https://knative.dev/docs/serving/services/private-services/
service.Labels[types.KnativeVisibilityLabel] = types.KnativeClusterLocalValue

if service.VO != "" {
for _, vo := range kn.config.OIDCGroups {
if vo == service.VO {
service.Labels["vo"] = service.VO
}
}
}

podSpec, err := service.ToPodSpec(kn.config)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ total_memory: ""
total_cpu: ""
enable_gpu: false
enable_sgx: false
vo: ""
image_prefetch: false
synchronous:
min_scale: 0
Expand Down Expand Up @@ -252,6 +251,7 @@ environment:
TEST_VAR: testvalue
annotations:
testannotation: testannotationvalue
vo: ""
labels:
testlabel: testlabelvalue
storage_providers:
Expand Down

0 comments on commit f6839a9

Please sign in to comment.