Skip to content

Commit

Permalink
fix: binding request field should not be returned when empty (#818)
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 49d2ae9 commit 4b602eb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/codeready-toolchain/toolchain-e2e

require (
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/davecgh/go-spew v1.1.1
github.com/fatih/color v1.12.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo=
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
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/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,12 @@ func TestSpaceLister(t *testing.T) {
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), "car", commonproxy.WithType("home"), appStudioTierRolesWSOption,
commonproxy.WithBindings([]toolchainv1alpha1.Binding{
{MasterUserRecord: "bus", Role: "admin",
AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: busSBROnCarSpace.GetName(),
Namespace: busSBROnCarSpace.GetNamespace(),
}},
{MasterUserRecord: "car", Role: "admin", AvailableActions: []string(nil)}, // no actions since this is system generated binding
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: bicycleSBROnCarSpace.GetName(),
Namespace: bicycleSBROnCarSpace.GetNamespace(),
}}},
Expand Down Expand Up @@ -797,7 +797,7 @@ func TestSpaceLister(t *testing.T) {
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), "bus", commonproxy.WithType("home"), appStudioTierRolesWSOption,
commonproxy.WithBindings([]toolchainv1alpha1.Binding{
{MasterUserRecord: "bus", Role: "admin", AvailableActions: []string(nil)}, // this is system generated so no actions for the user
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: bicycleSBROnBusSpace.GetName(),
Namespace: bicycleSBROnBusSpace.GetNamespace(),
}}})),
Expand All @@ -812,12 +812,12 @@ func TestSpaceLister(t *testing.T) {
require.NoError(t, err)
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), "car", appStudioTierRolesWSOption,
commonproxy.WithBindings([]toolchainv1alpha1.Binding{
{MasterUserRecord: "bus", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
{MasterUserRecord: "bus", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: busSBROnCarSpace.GetName(),
Namespace: busSBROnCarSpace.GetNamespace(),
}},
{MasterUserRecord: "car", Role: "admin", AvailableActions: []string(nil)}, // this is system generated so no actions for the user
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: bicycleSBROnCarSpace.GetName(),
Namespace: bicycleSBROnCarSpace.GetNamespace(),
}}},
Expand Down Expand Up @@ -848,7 +848,7 @@ func TestSpaceLister(t *testing.T) {
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), "bus", appStudioTierRolesWSOption,
commonproxy.WithBindings([]toolchainv1alpha1.Binding{
{MasterUserRecord: "bus", Role: "admin", AvailableActions: []string(nil)}, // this is system generated so no actions for the user
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: bicycleSBROnBusSpace.GetName(),
Namespace: bicycleSBROnBusSpace.GetNamespace(),
}}},
Expand All @@ -864,12 +864,12 @@ func TestSpaceLister(t *testing.T) {
require.NoError(t, err)
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), "car", appStudioTierRolesWSOption,
commonproxy.WithBindings([]toolchainv1alpha1.Binding{
{MasterUserRecord: "bus", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
{MasterUserRecord: "bus", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: busSBROnCarSpace.GetName(),
Namespace: busSBROnCarSpace.GetNamespace(),
}},
{MasterUserRecord: "car", Role: "admin", AvailableActions: []string(nil)}, // this is system generated so no actions for the user
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: toolchainv1alpha1.BindingRequest{
{MasterUserRecord: "road-bicycle", Role: "admin", AvailableActions: []string{"update", "delete"}, BindingRequest: &toolchainv1alpha1.BindingRequest{
Name: bicycleSBROnCarSpace.GetName(),
Namespace: bicycleSBROnCarSpace.GetNamespace(),
}}}, // this is system generated so no actions for the user
Expand Down

0 comments on commit 4b602eb

Please sign in to comment.