diff --git a/.gitignore b/.gitignore index 63c244c1..fff99f0e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ publish-develop.sh make-binary.sh .idea test-for-pagination.sh +export-cli.sh diff --git a/quota/quota.go b/quota/quota.go index b751cbdc..1c64a5eb 100644 --- a/quota/quota.go +++ b/quota/quota.go @@ -4,6 +4,9 @@ import ( "context" "encoding/json" "fmt" + "reflect" + "strings" + "github.com/cloudfoundry-community/go-cfclient/v3/client" "github.com/cloudfoundry-community/go-cfclient/v3/resource" "github.com/pkg/errors" @@ -11,8 +14,6 @@ import ( "github.com/vmwarepivotallabs/cf-mgmt/organizationreader" "github.com/vmwarepivotallabs/cf-mgmt/space" "github.com/xchapter7x/lo" - "reflect" - "strings" ) // NewManager - @@ -274,6 +275,7 @@ func (m *Manager) UpdateSpaceQuota(quotaGUID string, quota *resource.SpaceQuotaC return nil } lo.G.Infof("Updating space quota %s", *quota.Name) + quota.Relationships = nil _, err := m.SpaceQuoteClient.Update(context.Background(), quotaGUID, quota) return err } diff --git a/quota/quota_test.go b/quota/quota_test.go index 133c21dc..7d8e878d 100644 --- a/quota/quota_test.go +++ b/quota/quota_test.go @@ -288,7 +288,7 @@ var _ = Describe("given QuotaManager", func() { _, quotaGUID, quotaRequest := fakeSpaceQuotaClient.UpdateArgsForCall(0) Expect(quotaGUID).Should(Equal("space-quota-guid")) Expect(*quotaRequest.Name).Should(Equal("space1")) - Expect(quotaRequest.Relationships).ShouldNot(BeNil()) + Expect(quotaRequest.Relationships).Should(BeNil()) Expect(fakeSpaceQuotaClient.ApplyCallCount()).Should(Equal(1)) _, quotaGUID, spaceGUIDs := fakeSpaceQuotaClient.ApplyArgsForCall(0) Expect(quotaGUID).Should(Equal("space-quota-guid"))