Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add PublicViewer support #417

Closed
wants to merge 9 commits into from
Closed
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
5 changes: 3 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func main() {
panic(err.Error())
}

app, err := server.NewInClusterApplication(*informer)
pvcfg := crtConfig.PublicViewer()
app, err := server.NewInClusterApplication(*informer, pvcfg)
if err != nil {
panic(err.Error())
}
Expand All @@ -114,7 +115,7 @@ func main() {
metricsSrv := proxyMetrics.StartMetricsServer()

// Start the proxy server
p, err := proxy.NewProxy(app, proxyMetrics, cluster.GetMemberClusters)
p, err := proxy.NewProxy(app, proxyMetrics, cluster.GetMemberClusters, &pvcfg)
if err != nil {
panic(errs.Wrap(err, "failed to create proxy"))
}
Expand Down
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/aws/aws-sdk-go v1.44.100
github.com/codeready-toolchain/api v0.0.0-20240227210924-371ddb054d87
github.com/codeready-toolchain/api v0.0.0-20240322110702-5ab3840476e9
github.com/codeready-toolchain/toolchain-common v0.0.0-20240313081501-5cafefaa6598
github.com/go-logr/logr v1.2.3
github.com/gofrs/uuid v4.2.0+incompatible
Expand Down Expand Up @@ -146,3 +146,7 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/codeready-toolchain/toolchain-common => github.com/filariow/toolchain-common v0.0.0-20240322165115-87027670d9b3

replace github.com/codeready-toolchain/api => github.com/filariow/toolchain-api v0.0.0-20240322163859-f974f2dbbc8e
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/codeready-toolchain/api v0.0.0-20240227210924-371ddb054d87 h1:eQLsrMqfjAzGfuO9t6pVxO4K6cUDKOMxEvl0ujQq/2I=
github.com/codeready-toolchain/api v0.0.0-20240227210924-371ddb054d87/go.mod h1:FO7kgXH1x1LqkF327D5a36u0WIrwjVCbeijPkzgwaZc=
github.com/codeready-toolchain/toolchain-common v0.0.0-20240313081501-5cafefaa6598 h1:06nit/nCQFVKp51ZtIOyY49ncmxEK5shJGTaM+Ogicw=
github.com/codeready-toolchain/toolchain-common v0.0.0-20240313081501-5cafefaa6598/go.mod h1:c2JxboVI7keMD5fx5bB7LwzowFYYTwbepJhzPWSYXVs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand All @@ -143,6 +139,10 @@ github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCv
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/filariow/toolchain-api v0.0.0-20240322163859-f974f2dbbc8e h1:h+uO6jYovPD3j9VIo9JajpmTZIyl7x6wSap/4RjS6aw=
github.com/filariow/toolchain-api v0.0.0-20240322163859-f974f2dbbc8e/go.mod h1:cfNN6YPX4TORvhhZXMSjSPesqAHlB3nD/WAfGe4WLKQ=
github.com/filariow/toolchain-common v0.0.0-20240322165115-87027670d9b3 h1:k1kjVkS1CUazxpA8Hu0X6M4ChubNhGmHSQUEUhfGo4I=
github.com/filariow/toolchain-common v0.0.0-20240322165115-87027670d9b3/go.mod h1:2vTPf4wRr6Q9Pq3zkJ5I3wBNagXEMvyjmdk8w0/UJRE=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
Expand Down
10 changes: 9 additions & 1 deletion pkg/application/service/factory/service_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
clusterservice "github.com/codeready-toolchain/registration-service/pkg/proxy/service"
signupservice "github.com/codeready-toolchain/registration-service/pkg/signup/service"
verificationservice "github.com/codeready-toolchain/registration-service/pkg/verification/service"
commonconfig "github.com/codeready-toolchain/toolchain-common/pkg/configuration"
)

type serviceContextImpl struct {
Expand Down Expand Up @@ -54,6 +55,7 @@ type ServiceFactory struct {
verificationServiceOptions []verificationservice.VerificationServiceOption
signupServiceFunc func(opts ...signupservice.SignupServiceOption) service.SignupService
signupServiceOptions []signupservice.SignupServiceOption
publicViewerConfig commonconfig.PublicViewerConfig
}

func (s *ServiceFactory) defaultServiceContextProducer() servicecontext.ServiceContextProducer {
Expand All @@ -69,7 +71,7 @@ func (s *ServiceFactory) InformerService() service.InformerService {
}

func (s *ServiceFactory) MemberClusterService() service.MemberClusterService {
return clusterservice.NewMemberClusterService(s.getContext())
return clusterservice.NewMemberClusterService(s.getContext(), clusterservice.WithPublicViewerConfig(s.publicViewerConfig))
}

func (s *ServiceFactory) SignupService() service.SignupService {
Expand Down Expand Up @@ -97,6 +99,12 @@ func WithServiceContextOptions(opts ...ServiceContextOption) func(f *ServiceFact
}
}

func WithPublicViewerConfig(config commonconfig.PublicViewerConfig) func(f *ServiceFactory) {
return func(f *ServiceFactory) {
f.publicViewerConfig = config
}
}

func NewServiceFactory(options ...Option) *ServiceFactory {
f := &ServiceFactory{
serviceContextOptions: []ServiceContextOption{},
Expand Down
4 changes: 4 additions & 0 deletions pkg/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ func (r RegistrationServiceConfig) Print() {
logger.Info("Registration Service Configuration", "config", r.cfg.Host.RegistrationService)
}

func (r RegistrationServiceConfig) PublicViewer() commonconfig.PublicViewerConfig {
return commonconfig.PublicViewerConfig{Config: r.cfg.Global.PublicViewer}
}

func (r RegistrationServiceConfig) Environment() string {
return commonconfig.GetString(r.cfg.Host.RegistrationService.Environment, prodEnvironment)
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ func (l *Logger) InfoEchof(ctx echo.Context, msg string, args ...string) {
ctxFields = append(ctxFields, "url")
ctxFields = append(ctxFields, ctx.Request().URL)

if ssoUser, ok := ctx.Get("SSO-User").(string); ok {
ctxFields = append(ctxFields, "SSO-User", ssoUser)
}

if impersonateUser, ok := ctx.Get("Impersonate-User").(string); ok {
ctxFields = append(ctxFields, "Impersonate-User", impersonateUser)
}

l.infof(ctxFields, msg, args...)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/proxy/handlers/spacelister.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (s *SpaceLister) GetProvisionedUserSignup(ctx echo.Context) (*signup.Signup
return userSignup, nil
}

func createWorkspaceObject(signupName string, space *toolchainv1alpha1.Space, spaceBinding *toolchainv1alpha1.SpaceBinding, wsAdditionalOptions ...commonproxy.WorkspaceOption) *toolchainv1alpha1.Workspace {
func createWorkspaceObject(signupName *string, space *toolchainv1alpha1.Space, spaceBinding *toolchainv1alpha1.SpaceBinding, wsAdditionalOptions ...commonproxy.WorkspaceOption) *toolchainv1alpha1.Workspace {
// TODO right now we get SpaceCreatorLabelKey but should get owner from Space once it's implemented
ownerName := space.Labels[toolchainv1alpha1.SpaceCreatorLabelKey]

Expand All @@ -68,7 +68,7 @@ func createWorkspaceObject(signupName string, space *toolchainv1alpha1.Space, sp
}
// set the workspace type to "home" to indicate it is the user's home space
// TODO set home type based on UserSignup.Status.HomeSpace once it's implemented
if ownerName == signupName {
if signupName != nil && ownerName == *signupName {
wsOptions = append(wsOptions, commonproxy.WithType("home"))
}
wsOptions = append(wsOptions, wsAdditionalOptions...)
Expand Down
47 changes: 35 additions & 12 deletions pkg/proxy/handlers/spacelister_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/codeready-toolchain/registration-service/pkg/metrics"
"github.com/codeready-toolchain/registration-service/pkg/signup"
"github.com/codeready-toolchain/toolchain-common/pkg/cluster"
commonconfig "github.com/codeready-toolchain/toolchain-common/pkg/configuration"
commonproxy "github.com/codeready-toolchain/toolchain-common/pkg/proxy"
"github.com/codeready-toolchain/toolchain-common/pkg/spacebinding"
"github.com/labstack/echo/v4"
Expand All @@ -23,11 +24,11 @@ import (
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"
)

func HandleSpaceGetRequest(spaceLister *SpaceLister, GetMembersFunc cluster.GetMemberClustersFunc) echo.HandlerFunc {
func HandleSpaceGetRequest(spaceLister *SpaceLister, GetMembersFunc cluster.GetMemberClustersFunc, publicViewerConfig *commonconfig.PublicViewerConfig) echo.HandlerFunc {
// get specific workspace
return func(ctx echo.Context) error {
requestReceivedTime := ctx.Get(regsercontext.RequestReceivedTime).(time.Time)
workspace, err := GetUserWorkspaceWithBindings(ctx, spaceLister, ctx.Param("workspace"), GetMembersFunc)
workspace, err := GetUserWorkspaceWithBindings(ctx, spaceLister, ctx.Param("workspace"), GetMembersFunc, publicViewerConfig)
if err != nil {
spaceLister.ProxyMetrics.RegServWorkspaceHistogramVec.WithLabelValues(fmt.Sprintf("%d", http.StatusInternalServerError), metrics.MetricsLabelVerbGet).Observe(time.Since(requestReceivedTime).Seconds()) // using list as the default value for verb to minimize label combinations for prometheus to process
return errorResponse(ctx, apierrors.NewInternalError(err))
Expand All @@ -45,15 +46,27 @@ func HandleSpaceGetRequest(spaceLister *SpaceLister, GetMembersFunc cluster.GetM

// GetUserWorkspace returns a workspace object with the required fields used by the proxy
func GetUserWorkspace(ctx echo.Context, spaceLister *SpaceLister, workspaceName string) (*toolchainv1alpha1.Workspace, error) {
userSignup, space, err := getUserSignupAndSpace(ctx, spaceLister, workspaceName)
userSignup, err := spaceLister.GetProvisionedUserSignup(ctx)
if err != nil {
ctx.Logger().Error(errs.Wrap(err, "provisioned user signup error"))
return nil, err
}
// signup is not ready
if userSignup == nil || space == nil {

if userSignup == nil {
return nil, nil
}

return GetUserWorkspaceForSignup(ctx, spaceLister, userSignup, workspaceName)
}

// GetUserWorkspace returns a workspace object with the required fields used by the proxy
func GetUserWorkspaceForSignup(ctx echo.Context, spaceLister *SpaceLister, userSignup *signup.Signup, workspaceName string) (*toolchainv1alpha1.Workspace, error) {
space, err := spaceLister.GetInformerServiceFunc().GetSpace(workspaceName)
if err != nil {
ctx.Logger().Error(errs.Wrap(err, "unable to get space"))
return nil, err
}

// recursively get all the spacebindings for the current workspace
listSpaceBindingsFunc := func(spaceName string) ([]toolchainv1alpha1.SpaceBinding, error) {
spaceSelector, err := labels.NewRequirement(toolchainv1alpha1.SpaceBindingSpaceLabelKey, selection.Equals, []string{spaceName})
Expand Down Expand Up @@ -84,20 +97,27 @@ func GetUserWorkspace(ctx echo.Context, spaceLister *SpaceLister, workspaceName
return nil, userBindingsErr
}

return createWorkspaceObject(userSignup.Name, space, &userSpaceBindings[0]), nil
return createWorkspaceObject(&userSignup.Name, space, &userSpaceBindings[0]), nil
}

// GetUserWorkspaceWithBindings returns a workspace object with the required fields+bindings (the list with all the users access details)
func GetUserWorkspaceWithBindings(ctx echo.Context, spaceLister *SpaceLister, workspaceName string, GetMembersFunc cluster.GetMemberClustersFunc) (*toolchainv1alpha1.Workspace, error) {
func GetUserWorkspaceWithBindings(ctx echo.Context, spaceLister *SpaceLister, workspaceName string, GetMembersFunc cluster.GetMemberClustersFunc, publicViewerConfig *commonconfig.PublicViewerConfig) (*toolchainv1alpha1.Workspace, error) {
userSignup, space, err := getUserSignupAndSpace(ctx, spaceLister, workspaceName)
if err != nil {
return nil, err
}
// signup is not ready
if userSignup == nil || space == nil {
if space == nil || (userSignup == nil && !publicViewerConfig.Enabled()) {
return nil, nil
}

if userSignup == nil {
userSignup = &signup.Signup{
CompliantUsername: publicViewerConfig.Username(),
Name: publicViewerConfig.Username(),
}
}

// recursively get all the spacebindings for the current workspace
listSpaceBindingsFunc := func(spaceName string) ([]toolchainv1alpha1.SpaceBinding, error) {
spaceSelector, err := labels.NewRequirement(toolchainv1alpha1.SpaceBindingSpaceLabelKey, selection.Equals, []string{spaceName})
Expand All @@ -116,9 +136,12 @@ func GetUserWorkspaceWithBindings(ctx echo.Context, spaceLister *SpaceLister, wo
// check if user has access to this workspace
userBinding := filterUserSpaceBinding(userSignup.CompliantUsername, allSpaceBindings)
if userBinding == nil {
// let's only log the issue and consider this as not found
ctx.Logger().Error(fmt.Sprintf("unauthorized access - there is no SpaceBinding present for the user %s and the workspace %s", userSignup.CompliantUsername, workspaceName))
return nil, nil
userBinding = filterUserSpaceBinding(publicViewerConfig.Username(), allSpaceBindings)
if userBinding == nil {
// let's only log the issue and consider this as not found
ctx.Logger().Error(fmt.Sprintf("unauthorized access - there is no SpaceBinding present for the user %s and the workspace %s", userSignup.CompliantUsername, workspaceName))
return nil, nil
}
}

// list all SpaceBindingRequests , just in case there might be some failing to create a SpaceBinding resource.
Expand All @@ -142,7 +165,7 @@ func GetUserWorkspaceWithBindings(ctx echo.Context, spaceLister *SpaceLister, wo
return nil, err
}

return createWorkspaceObject(userSignup.Name, space, userBinding,
return createWorkspaceObject(&userSignup.Name, space, userBinding,
commonproxy.WithAvailableRoles(getRolesFromNSTemplateTier(nsTemplateTier)),
commonproxy.WithBindings(bindings),
), nil
Expand Down
6 changes: 4 additions & 2 deletions pkg/proxy/handlers/spacelister_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/codeready-toolchain/registration-service/pkg/signup"
"github.com/codeready-toolchain/registration-service/test/fake"
commoncluster "github.com/codeready-toolchain/toolchain-common/pkg/cluster"
"github.com/codeready-toolchain/toolchain-common/pkg/configuration"
commonproxy "github.com/codeready-toolchain/toolchain-common/pkg/proxy"
"github.com/codeready-toolchain/toolchain-common/pkg/test"
spacetest "github.com/codeready-toolchain/toolchain-common/pkg/test/space"
Expand All @@ -32,7 +33,8 @@ import (
)

func TestSpaceListerGet(t *testing.T) {
fakeSignupService, fakeClient := buildSpaceListerFakes(t)
cfg := &configuration.PublicViewerConfig{Config: toolchainv1alpha1.PublicViewerConfig{Enabled: false}}
fakeSignupService, fakeClient := buildSpaceListerFakes(t, cfg)

memberFakeClient := fake.InitClient(t,
// spacebinding requests
Expand Down Expand Up @@ -564,7 +566,7 @@ func TestSpaceListerGet(t *testing.T) {
if tc.overrideGetMembersFunc != nil {
getMembersFunc = tc.overrideGetMembersFunc
}
err := handlers.HandleSpaceGetRequest(s, getMembersFunc)(ctx)
err := handlers.HandleSpaceGetRequest(s, getMembersFunc, cfg)(ctx)

// then
if tc.expectedErr != "" {
Expand Down
49 changes: 33 additions & 16 deletions pkg/proxy/handlers/spacelister_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ import (
"net/http"
"time"

toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1"
"github.com/codeready-toolchain/registration-service/pkg/context"
"github.com/codeready-toolchain/registration-service/pkg/metrics"
"github.com/labstack/echo/v4"
errs "github.com/pkg/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/selection"

toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1"
"github.com/codeready-toolchain/registration-service/pkg/context"
"github.com/codeready-toolchain/registration-service/pkg/metrics"
commonconfig "github.com/codeready-toolchain/toolchain-common/pkg/configuration"
)

func HandleSpaceListRequest(spaceLister *SpaceLister) echo.HandlerFunc {
func HandleSpaceListRequest(spaceLister *SpaceLister, publicViewerConfig *commonconfig.PublicViewerConfig) echo.HandlerFunc {
return func(ctx echo.Context) error {
// list all user workspaces
requestReceivedTime := ctx.Get(context.RequestReceivedTime).(time.Time)
workspaces, err := ListUserWorkspaces(ctx, spaceLister)
workspaces, err := ListUserWorkspaces(ctx, spaceLister, publicViewerConfig)
if err != nil {
spaceLister.ProxyMetrics.RegServWorkspaceHistogramVec.WithLabelValues(fmt.Sprintf("%d", http.StatusInternalServerError), metrics.MetricsLabelVerbList).Observe(time.Since(requestReceivedTime).Seconds()) // using list as the default value for verb to minimize label combinations for prometheus to process
return errorResponse(ctx, apierrors.NewInternalError(err))
Expand All @@ -33,24 +35,40 @@ func HandleSpaceListRequest(spaceLister *SpaceLister) echo.HandlerFunc {

// ListUserWorkspaces returns a list of Workspaces for the current user.
// The function lists all SpaceBindings for the user and return all the workspaces found from this list.
func ListUserWorkspaces(ctx echo.Context, spaceLister *SpaceLister) ([]toolchainv1alpha1.Workspace, error) {
func ListUserWorkspaces(ctx echo.Context, spaceLister *SpaceLister, publicViewerConfig *commonconfig.PublicViewerConfig) ([]toolchainv1alpha1.Workspace, error) {
signup, err := spaceLister.GetProvisionedUserSignup(ctx)
if err != nil {
return nil, err
}

// signup is not ready
if signup == nil {
return []toolchainv1alpha1.Workspace{}, nil
var murName *string
if signup != nil {
murName = &signup.CompliantUsername
}
murName := signup.CompliantUsername

murNames := func() []string {
names := []string{}
if publicViewerConfig.Enabled() {
names = append(names, publicViewerConfig.Username())
}

if murName != nil {
names = append(names, *murName)
}
return names
}()
if len(murNames) == 0 {
return nil, nil
}
// get all spacebindings with given mur since no workspace was provided
spaceBindings, err := listSpaceBindingsForUser(spaceLister, murName)
spaceBindings, err := listSpaceBindingsForUsers(spaceLister, murNames)
if err != nil {
ctx.Logger().Error(errs.Wrap(err, "error listing space bindings"))
return nil, err
}
return workspacesFromSpaceBindings(ctx, spaceLister, signup.Name, spaceBindings), nil

return workspacesFromSpaceBindings(ctx, spaceLister, murName, spaceBindings), nil
}

func listWorkspaceResponse(ctx echo.Context, workspaces []toolchainv1alpha1.Workspace) error {
Expand All @@ -67,16 +85,15 @@ func listWorkspaceResponse(ctx echo.Context, workspaces []toolchainv1alpha1.Work
return json.NewEncoder(ctx.Response().Writer).Encode(workspaceList)
}

func listSpaceBindingsForUser(spaceLister *SpaceLister, murName string) ([]toolchainv1alpha1.SpaceBinding, error) {
murSelector, err := labels.NewRequirement(toolchainv1alpha1.SpaceBindingMasterUserRecordLabelKey, selection.Equals, []string{murName})
func listSpaceBindingsForUsers(spaceLister *SpaceLister, murNames []string) ([]toolchainv1alpha1.SpaceBinding, error) {
murSelector, err := labels.NewRequirement(toolchainv1alpha1.SpaceBindingMasterUserRecordLabelKey, selection.In, murNames)
if err != nil {
return nil, err
}
requirements := []labels.Requirement{*murSelector}
return spaceLister.GetInformerServiceFunc().ListSpaceBindings(requirements...)
return spaceLister.GetInformerServiceFunc().ListSpaceBindings(*murSelector)
}

func workspacesFromSpaceBindings(ctx echo.Context, spaceLister *SpaceLister, signupName string, spaceBindings []toolchainv1alpha1.SpaceBinding) []toolchainv1alpha1.Workspace {
func workspacesFromSpaceBindings(ctx echo.Context, spaceLister *SpaceLister, signupName *string, spaceBindings []toolchainv1alpha1.SpaceBinding) []toolchainv1alpha1.Workspace {
workspaces := []toolchainv1alpha1.Workspace{}
for i := range spaceBindings {
spacebinding := &spaceBindings[i]
Expand Down
Loading
Loading