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

Task: update Resourcegroup controller to catch and handle "LocationNotAvailableForResourceGroup" #733

Closed
jananivMS opened this issue Mar 9, 2020 · 0 comments · Fixed by #821
Assignees
Labels
bug 🪲 Something isn't working

Comments

@jananivMS
Copy link
Contributor

Now that we have enabled the operator to work on multiple cloud environments, there are certain locations that do not work for a particular cloud environment. Ran into this error when trying to create a RG in a location not available for the current Cloud env.

To Reproduce
Steps to reproduce the behavior:

  1. Update location in RG yaml to "chinanorth"
  2. Try creating that using the operator (with the AzurePublicCloud environment which is our default)

Expected behavior
The operator should handle this error and end reconciliation with a failed reconcile.
However, the operator reports an error which results in requeuing of the operator. for an error that is unrecoverable.

2020-03-09T11:48:30.919-0600	ERROR	controller-runtime.controller	Reconciler error	{"controller": "resourcegroup", "request": "default/jv-rgtest1", "error": "1 error occurred:\n\t* ResourceGroup create error resources.GroupsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code=\"LocationNotAvailableForResourceGroup\" Message=\"The provided location 'westus' is not available for resource group. List of available regions is 'chinanorth,chinaeast,chinanorth2,chinaeast2'.\"\n\n"}
github.com/go-logr/zapr.(*zapLogger).Error
	/Users/jananiv/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/Users/jananiv/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.0-beta.4/pkg/internal/controller/controller.go:218
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/Users/jananiv/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.0-beta.4/pkg/internal/controller/controller.go:192
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker
	/Users/jananiv/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.0-beta.4/pkg/internal/controller/controller.go:171
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1
	/Users/jananiv/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:152
k8s.io/apimachinery/pkg/util/wait.JitterUntil
	/Users/jananiv/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:153
k8s.io/apimachinery/pkg/util/wait.Until
	/Users/jananiv/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:88
@jananivMS jananivMS added bug 🪲 Something isn't working triaged labels Mar 9, 2020
@frodopwns frodopwns self-assigned this Mar 25, 2020
@frodopwns frodopwns changed the title Bug: Resourcegroup controller: Need to catch and handle "LocationNotAvailableForResourceGroup" error for RG creation Task: update Resourcegroup controller to catch and handle "LocationNotAvailableForResourceGroup" Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants