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

Make Port Name Optional #287

Merged
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
2 changes: 0 additions & 2 deletions internal/ent/generated/port/port.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions internal/ent/generated/port_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions internal/ent/generated/port_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions internal/ent/generated/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion internal/ent/schema/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func (Port) Fields() []ent.Field {
entgql.OrderField("number"),
),
field.String("name").
NotEmpty().
Annotations(
entgql.OrderField("name"),
),
Expand Down
10 changes: 4 additions & 6 deletions internal/graphapi/loadbalancer.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions internal/graphapi/origin.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions internal/graphapi/pool.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions internal/graphapi/port.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions internal/graphapi/port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ func TestCreate_LoadbalancerPort(t *testing.T) {
},
},
{
TestName: "fails to create loadbalancer port with empty name",
TestName: "succeeds in creating loadbalancer port with empty name",
Input: graphclient.CreateLoadBalancerPortInput{
Name: "",
LoadBalancerID: lb.ID,
Number: 22,
Number: 23,
},
Expected: &graphclient.LoadBalancerPort{
Name: "",
Number: 23,
},
errorMsg: "value is less than the required length",
},
{
TestName: "fails to create loadbalancer port with empty loadbalancer id",
Expand Down Expand Up @@ -220,12 +223,15 @@ func TestUpdate_LoadbalancerPort(t *testing.T) {
},
},
{
TestName: "fails to update loadbalancer port name to empty",
TestName: "succeeds in updating loadbalancer port name to empty",
ID: port.ID,
Input: graphclient.UpdateLoadBalancerPortInput{
Name: newString(""),
},
errorMsg: "value is less than the required length",
Expected: &graphclient.LoadBalancerPort{
Name: "",
Number: 22,
},
},
{
TestName: "fails to update loadbalancer port number < min",
Expand Down
Loading