Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions controllers/workspace/provision/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package provision
import (
"context"
"fmt"
"strings"

devworkspace "github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
"github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
Expand Down Expand Up @@ -147,6 +148,14 @@ func getSpecRouting(
annotations[config.WorkspaceRestrictedAccessAnnotation] = val
}

// copy the annotations for the specific routingClass from the workspace object to the routing
expectedAnnotationPrefix := workspace.Spec.RoutingClass + config.RoutingAnnotationInfix
for k, v := range workspace.GetAnnotations() {
if strings.HasPrefix(k, expectedAnnotationPrefix) {
annotations[k] = v
}
}

routing := &v1alpha1.WorkspaceRouting{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("routing-%s", workspace.Status.WorkspaceId),
Expand Down
4 changes: 4 additions & 0 deletions pkg/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ const (

// PVCCleanupPodMemoryLimit is the memory limit used for PVC clean up pods
PVCCleanupPodMemoryLimit = "32Mi"

// RoutingAnnotationInfix is the infix of the annotations of DevWorkspace that are passed down as annotation to the WorkspaceRouting objects.
// The full annotation name is supposed to be "<routingClass>.routing.controller.devfile.io/<anything>"
RoutingAnnotationInfix = ".routing.controller.devfile.io/"
)

// Constants for che-rest-apis
Expand Down