-
Notifications
You must be signed in to change notification settings - Fork 138
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
Setting weight 0 on backends leads to weight 100. #109
Comments
👋 thanks for opening this issue!
I don't think it should create a backend with a weight of 0 because a value of 0 doesn't prevent it from receiving traffic! Useful values for the weight field are integers from 1 to 100. For reference please have a look at the Fastly API Docs. You have to use a condition in order to prevent a backend from receiving traffic. I do agree that the provider should have validation for this field. I'll open a PR to validate the weight field and only let values from 1 to 100 pass it soon. |
@philippschulte Please note that setting the value to 0 works in the Fastly console (I recall I verified it decreases the traffic to 0) despite what the docs say. I would argue the behavior should be consistent between the two. |
I can confirm that the Fastly API accepts a weight of 0 but it also accepts any signed or unsigned integer. The Fastly API doesn't perform any validation for this field.
I agree! However, I need to confirm that
is actually working as you are reporting. Even if I'll discuss this internally with my co-workers. The solution will be a validator the only question is if the range will be from 1-100 or 0-100. In case we decide the range to be 0-100 then it is a larger problem which needs to be solved in the go-fastly HTTP client. |
should be fixed in #511 |
Setting weight 0 on backends leads to weight 100 in the console and VCL file. It goes without saying that it might be dangerous if the weight 0 backend is not ready for high capacity traffic.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Should create a backend with a weight 0, or at least throw an input validation error.
Actual Behavior
Creates a backend with a weight 100
Steps to Reproduce
terraform apply
Important Factoids
The
terraform apply
actually shows the weight is going to be set to 0. You only found out it had been changed to 100 in the console and the VCL file.Setting the weight to 0 is not a problem in the Fastly console.
The text was updated successfully, but these errors were encountered: