-
Notifications
You must be signed in to change notification settings - Fork 127
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
feat(lb): add lb beta resource #278
Conversation
scaleway/helpers_test.go
Outdated
@@ -192,3 +195,40 @@ func TestGetRandomName(t *testing.T) { | |||
name := getRandomName("test") | |||
assert.True(t, strings.HasPrefix(name, "tf-test-")) | |||
} | |||
|
|||
var IPv4Regexp = regexp.MustCompile("([0-9]{1,3}.){3}[0-9]{1,3}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use net.ParseIP()
==> https://play.golang.org/p/QkKbbJSrOCT
scaleway/helpers_test.go
Outdated
} | ||
|
||
func testCheckResourceAttrUUID(name string, key string) resource.TestCheckFunc { | ||
return testCheckResourceAttrRegex(name, key, UUIDRegex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scaleway/resource_lb_lb_beta.go
Outdated
Optional: true, | ||
Description: "Array of tags to associate with the load-balancer", | ||
}, | ||
"ips": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we add an IP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IP is computed for now when the will allow IP previsioning before we will have a instance style attach/detach paradigm. As this will break soon i remove list for now
scaleway/resource_lb_lb_beta.go
Outdated
|
||
func resourceScalewayLbLbBeta() *schema.Resource { | ||
return &schema.Resource{ | ||
Create: resourceScalewayLbLbBetaCreate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate LbLb
in the name (same for Read, Update and Delete)
scaleway/resource_lb_lb_beta.go
Outdated
}, | ||
SchemaVersion: 0, | ||
Timeouts: &schema.ResourceTimeout{ | ||
Create: &BaremetalServerResourceTimeout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LbResourceTimeout
scaleway/resource_lb_lb_beta.go
Outdated
} | ||
|
||
if d.HasChange("name") || d.HasChange("tags") { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove newline
scaleway/resource_lb_lb_beta.go
Outdated
err = lbAPI.DeleteLb(&lb.DeleteLbRequest{ | ||
Region: region, | ||
LbID: ID, | ||
// This parameter will probably be breaking change when ip pre reservation will exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
scaleway/resource_lb_beta.go
Outdated
}, | ||
"ip_id": { | ||
Type: schema.TypeString, | ||
Computed: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Need a
Description
scaleway/resource_lb_beta.go
Outdated
}, | ||
"ip_address": { | ||
Type: schema.TypeString, | ||
Computed: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Need a
Description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Linked to #294 |
No description provided.