Cleanup unused struct field

Remove `Pool` field from `CreateInstanceParams` struct, because
this is given as a separate parameter to the `CreateInstance` function.
This commit is contained in:
mihaelabalutoiu 2022-09-15 19:11:37 +03:00
parent 775dd51782
commit e2ada6d1e3
6 changed files with 1 additions and 11 deletions

View file

@ -26,7 +26,7 @@ import (
)
func (s *sqlDatabase) CreateInstance(ctx context.Context, poolID string, param params.CreateInstanceParams) (params.Instance, error) {
pool, err := s.getPoolByID(ctx, param.Pool)
pool, err := s.getPoolByID(ctx, poolID)
if err != nil {
return params.Instance{}, errors.Wrap(err, "fetching pool")
}

View file

@ -77,7 +77,6 @@ func (s *InstancesTestSuite) SetupTest() {
OSType: "linux",
OSArch: "amd64",
CallbackURL: "https://garm.example.com/",
Pool: pool.ID,
},
)
if err != nil {
@ -103,7 +102,6 @@ func (s *InstancesTestSuite) TestCreateInstance() {
OSType: "linux",
OSArch: "amd64",
CallbackURL: "https://garm.example.com/",
Pool: s.Fixtures.Pool.ID,
}
// call tested function