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

If there is a problem updating or creating a policy it never gets propagated to the user #1147

Open
KevinJCross opened this issue Dec 5, 2022 · 0 comments
Labels

Comments

@KevinJCross
Copy link
Contributor

KevinJCross commented Dec 5, 2022

Subject of the issue

If a schedule is updated and there was an error then this is not propagated to the cf api.
There are 2 types of error not propagated.

  • bad request ( bad schedule or policy)
  • Error saving or updating a policy

Expected behaviour

The golangapi service should propagate the 400 or error response back to the cc api so the user can retry or remediate the issue.

Actual behaviour

Currently we just sweep it under the rug by ALWAYS returning 200 OK..
it does have this test which suggest this is on purpose but why ?

Context("When scheduler returns non 200 and non 204 status code", func() {
			BeforeEach(func() {
				pathVariables["appId"] = TEST_APP_ID
				req, _ = http.NewRequest(http.MethodPut, "", bytes.NewBufferString(VALID_POLICY_STR))
				schedulerStatus = 500
			})
			It("should succeed", func() {
				Expect(resp.Code).To(Equal(http.StatusOK))
			})
		})

This was notice via code review in particular public_api_handler.go:L153-158

@KevinJCross KevinJCross added the bug label Dec 5, 2022
@KevinJCross KevinJCross changed the title If the scheduler can not add a schedule then error is not returned. If there is a problem updating or creating a policy it never gets propagated to the user Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant