Skip to content

Commit

Permalink
fix: binding request field should not be returned when empty (#358)
Browse files Browse the repository at this point in the history
* convert binding request to pointer
  • Loading branch information
mfrancisc authored Oct 13, 2023
1 parent 9dd5dd6 commit 14312cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/aws/aws-sdk-go v1.44.100
github.com/codeready-toolchain/api v0.0.0-20231010090546-098b27b43b3a
github.com/codeready-toolchain/api v0.0.0-20231013094356-24443ff2aa9a
github.com/codeready-toolchain/toolchain-common v0.0.0-20231012065805-a23f3cfa676d
github.com/go-logr/logr v1.2.3
github.com/gofrs/uuid v4.2.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ 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-20231010090546-098b27b43b3a h1:UucbKqQ0bz9xe/Hr6kbrJkPK0YzCn2bdFwGme5rCfuU=
github.com/codeready-toolchain/api v0.0.0-20231010090546-098b27b43b3a/go.mod h1:nn3W6eKb9PFIVwSwZW7wDeLACMBOwAV+4kddGuN+ARM=
github.com/codeready-toolchain/api v0.0.0-20231013094356-24443ff2aa9a h1:lbMkf/E687UY6Dbj8yjADmorNdC3a25eDgmhkzdnzc0=
github.com/codeready-toolchain/api v0.0.0-20231013094356-24443ff2aa9a/go.mod h1:bImSKnxrpNmCmW/YEGiiZnZqJm3kAmfP5hW4YndK0hE=
github.com/codeready-toolchain/toolchain-common v0.0.0-20231012065805-a23f3cfa676d h1:gQy0fpfCjl4XQhoXEQ3NUrvpRp4qKzov5TBKyePuwOM=
github.com/codeready-toolchain/toolchain-common v0.0.0-20231012065805-a23f3cfa676d/go.mod h1:SnZewh0DLwAELKLsW+R6NKaKmiRBuMI1iMYSkfyZG6A=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
Expand Down
2 changes: 1 addition & 1 deletion pkg/proxy/handlers/spacelister.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func generateWorkspaceBindings(space *toolchainv1alpha1.Space, spaceBindings []t
}
// this is a binding that was created via SpaceBindingRequest, it can be updated or deleted
binding.AvailableActions = []string{UpdateBindingAction, DeleteBindingAction}
binding.BindingRequest = toolchainv1alpha1.BindingRequest{
binding.BindingRequest = &toolchainv1alpha1.BindingRequest{
Name: sbrName,
Namespace: sbrNamespace,
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/proxy/handlers/spacelister_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func TestSpaceLister(t *testing.T) {
MasterUserRecord: "animelover",
Role: "viewer",
AvailableActions: []string{"update", "delete"},
BindingRequest: toolchainv1alpha1.BindingRequest{ // animelover was granted access to dancelover workspace using SpaceBindingRequest
BindingRequest: &toolchainv1alpha1.BindingRequest{ // animelover was granted access to dancelover workspace using SpaceBindingRequest
Name: "animelover-sbr",
Namespace: "dancelover-tenant",
},
Expand Down Expand Up @@ -269,7 +269,7 @@ func TestSpaceLister(t *testing.T) {
MasterUserRecord: "foodlover",
Role: "maintainer",
AvailableActions: []string{"update", "delete"},
BindingRequest: toolchainv1alpha1.BindingRequest{ // foodlover was granted access to movielover workspace using SpaceBindingRequest
BindingRequest: &toolchainv1alpha1.BindingRequest{ // foodlover was granted access to movielover workspace using SpaceBindingRequest
Name: "foodlover-sbr",
Namespace: "movielover-tenant",
},
Expand Down Expand Up @@ -327,7 +327,7 @@ func TestSpaceLister(t *testing.T) {
MasterUserRecord: "foodlover",
Role: "maintainer",
AvailableActions: []string{"update", "delete"},
BindingRequest: toolchainv1alpha1.BindingRequest{
BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: "foodlover-sbr",
Namespace: "movielover-tenant",
},
Expand Down Expand Up @@ -367,7 +367,7 @@ func TestSpaceLister(t *testing.T) {
MasterUserRecord: "foodlover", // foodlover was granted access to movielover workspace using SpaceBindingRequest
Role: "maintainer",
AvailableActions: []string{"update", "delete"},
BindingRequest: toolchainv1alpha1.BindingRequest{
BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: "foodlover-sbr",
Namespace: "movielover-tenant",
},
Expand Down

0 comments on commit 14312cb

Please sign in to comment.