Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Space Quota creation and assignement not working #462

Closed
marcohelmerich opened this issue Dec 1, 2023 · 2 comments
Closed

Space Quota creation and assignement not working #462

marcohelmerich opened this issue Dec 1, 2023 · 2 comments

Comments

@marcohelmerich
Copy link

marcohelmerich commented Dec 1, 2023

Describe the bug
It is not possible to create new space quotas anymore in the current cf-mgmt version. Updates of existing quotas are still working.

To Reproduce

  1. Create a new space in cf-mgmt config yamls with enalbe-space-quotas set to true
  2. Run cf-mgmt (in peek or real)
  3. Both ways will fail with differen errors. (Null Pointer in PEEK, CF-API Error in real)

Expected behavior
Space Quota should be created and assigned to space

Screenshots
dryrun

2023/11/30 08:50:26 D1130 08:50:26.322122 35866 reader.go:110] Total orgs returned : 51
2023/11/30 08:50:26 D1130 08:50:26.612253 35866 quota.go:261] Total space quotas returned : 0
2023/11/30 08:50:26 D1130 08:50:26.754391 35866 quota.go:476] Total org quotas returned : 54
2023/11/30 08:50:26 D1130 08:50:26.754481 35866 reader.go:110] Total orgs returned : 51
2023/11/30 08:50:26 I1130 08:50:26.754502 35866 quota.go:287] [dry-run]: creating quota PAPPA
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x12ee27d]

goroutine 1 [running]:
github.com/vmwarepivotallabs/cf-mgmt/quota.(*Manager).CreateSpaceQuotas(0xc0001ce840)
	/Users/marco.helmerich/git/cf-mgmt/quota/quota.go:97 +0x43d
github.com/vmwarepivotallabs/cf-mgmt/commands.(*UpdateSpaceQuotasCommand).Execute(0xc00011de50?, {0x13861a0?, 0x16def90?, 0xc0000a21a8?})
	/Users/marco.helmerich/git/cf-mgmt/commands/update_space_quota.go:13 +0x68
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc000172310, {0xc0000c2010, 0x1, 0x1})
	/Users/marco.helmerich/git/cf-mgmt/vendor/github.com/jessevdk/go-flags/parser.go:335 +0x97a
github.com/jessevdk/go-flags.(*Parser).Parse(...)
	/Users/marco.helmerich/git/cf-mgmt/vendor/github.com/jessevdk/go-flags/parser.go:191
main.main()
	/Users/marco.helmerich/git/cf-mgmt/cmd/cf-mgmt/main.go:15 +0x94

real:

❯./cf-mgmt  update-space-quotas
2023/11/30 09:08:04 D1130 09:08:04.614429 38640 initialize.go:74] Using Version: [0.0.0], Commit: [dev] of cf-mgmt
2023/11/30 09:08:04 W1130 09:08:04.80854 38640 yaml_config.go:542] Ldap bind password should be removed from ldap.yml as this will be deprecated in a future release.  Use --ldap-password flag instead.
2023/11/30 09:08:05 D1130 09:08:05.300148 38640 reader.go:110] Total orgs returned : 51
2023/11/30 09:08:05 D1130 09:08:05.707901 38640 quota.go:261] Total space quotas returned : 0
2023/11/30 09:08:05 D1130 09:08:05.859536 38640 quota.go:476] Total org quotas returned : 54
2023/11/30 09:08:05 D1130 09:08:05.859618 38640 reader.go:110] Total orgs returned : 51
2023/11/30 09:08:05 I1130 09:08:05.859641 38640 quota.go:290] Creating quota PAPPA
error: cfclient error (CF-UnprocessableEntity|10008): Relationships 'relationships' is not an object

Additional context
Unit Tests are working fine despite the errors, so there is an bug in the tests, too. We fixed the issue and the test and added a pull request, so that you can see the affected code segments. #463 #463

Assumption
Adding/Resolving Org and space relationships for the quota was missed out while migrating the code from v2 to v3.
In the tests, Relationships were given via fakes/mocks so the error never occured in the tests.

@cf-gitbot
Copy link
Collaborator

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@ifindlay-cci
Copy link
Contributor

Fixed by #465

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants