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

provider/scaleway: fix security_group_rule identification #8661

Merged
merged 1 commit into from
Sep 6, 2016
Merged

provider/scaleway: fix security_group_rule identification #8661

merged 1 commit into from
Sep 6, 2016

Conversation

nicolai86
Copy link
Contributor

@nicolai86 nicolai86 commented Sep 5, 2016

this PR fixes a bug in the scaleway security_group_rule: when storing the ID of a security group rule, the check to identify the rule was wrong.

before:

rule.Action == req.Action &&
            rule.Direction == req.Direction &&
            rule.IPRange == req.IPRange &&
            rule.Protocol == req.Protocol

after:

rule.Action == req.Action &&
            rule.Direction == req.Direction &&
            rule.IPRange == req.IPRange &&
            rule.Protocol == req.Protocol &&
            rule.DestPortFrom == req.DestPortFrom

this would result in terraform not properly identifying correct rules, thus not setting up security group rules properly.

see #7784 (comment) for a report (thanks @sheerun)

I've updated the tests to show the problem, and fix it accordingly:

make testacc TEST=./builtin/providers/scaleway TESTARGS='-run=TestAccScalewaySecurityGroupRule_Basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/05 16:33:12 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScalewaySecurityGroupRule_Basic -timeout 120m
=== RUN   TestAccScalewaySecurityGroupRule_Basic
--- PASS: TestAccScalewaySecurityGroupRule_Basic (3.71s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway   3.725s

@stack72
Copy link
Contributor

stack72 commented Sep 6, 2016

Hi @nicolai86

Thanks for the work here :) Always nice to close out bugs fast

% make testacc TEST=./builtin/providers/scaleway TESTARGS='-run=TestAccScalewaySecurityGroupRule_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/06 13:39:52 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScalewaySecurityGroupRule_ -timeout 120m
=== RUN   TestAccScalewaySecurityGroupRule_Basic
--- PASS: TestAccScalewaySecurityGroupRule_Basic (4.37s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway       4.387s

@stack72 stack72 merged commit fd541a4 into hashicorp:master Sep 6, 2016
@ghost
Copy link

ghost commented Apr 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants