Skip to content

Commit

Permalink
Merge pull request #26 from vladimirkrumshtein-f3/master
Browse files Browse the repository at this point in the history
fix: Ignore subnet property for the reservation
  • Loading branch information
fabiomatavelli-f3 authored Apr 8, 2024
2 parents 0dab4fe + 6472413 commit 479bdb5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Test
on:
push:
pull_request:
jobs:
setup-drp:
name: Setup DRP
Expand Down
7 changes: 0 additions & 7 deletions drpv4/resource_drp_reservation.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ func resourceReservation() *schema.Resource {
Optional: true,
Default: "MAC",
},
"subnet": {
Type: schema.TypeString,
Description: "Reservation subnet",
Optional: true,
},
"token": {
Type: schema.TypeString,
Description: "Reservation token",
Expand Down Expand Up @@ -140,7 +135,6 @@ func flattenReservation(d *schema.ResourceData, reservation *models.Reservation)

d.Set("scoped", reservation.Scoped)
d.Set("strategy", reservation.Strategy)
d.Set("subnet", reservation.Subnet)
d.Set("token", reservation.Token)

if reservation.Options != nil {
Expand Down Expand Up @@ -172,7 +166,6 @@ func expandReservation(d *schema.ResourceData) *models.Reservation {
Duration: int32(d.Get("duration").(int)),
Scoped: d.Get("scoped").(bool),
Strategy: d.Get("strategy").(string),
Subnet: d.Get("subnet").(string),
Token: d.Get("token").(string),
Options: expandReservationOptions(d.Get("options").([]interface{})),
}
Expand Down
5 changes: 0 additions & 5 deletions drpv4/resource_drp_reservation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func TestAccResourceReservation(t *testing.T) {
documentation = "test reservation"
duration = 86400
token = "ff:70:81:a9:78:4d"
subnet = "255.255.255.0"
}
`,
Check: resource.ComposeTestCheckFunc(
Expand All @@ -29,7 +28,6 @@ func TestAccResourceReservation(t *testing.T) {
resource.TestCheckResourceAttr("drp_reservation.test", "documentation", "test reservation"),
resource.TestCheckResourceAttr("drp_reservation.test", "duration", "86400"),
resource.TestCheckResourceAttr("drp_reservation.test", "token", "ff:70:81:a9:78:4d"),
resource.TestCheckResourceAttr("drp_reservation.test", "subnet", "255.255.255.0"),
),
},
{
Expand All @@ -41,7 +39,6 @@ func TestAccResourceReservation(t *testing.T) {
duration = 86400
token = "ff:70:81:a9:78:4d"
next_server = "192.168.1.1"
subnet = "255.255.255.0"
options {
code = 1
Expand All @@ -61,7 +58,6 @@ func TestAccResourceReservation(t *testing.T) {
documentation = "test reservation"
duration = 86400
token = "ff:70:81:a9:78:4d"
subnet = "255.255.255.0"
}
`,
Check: resource.ComposeTestCheckFunc(
Expand All @@ -76,7 +72,6 @@ func TestAccResourceReservation(t *testing.T) {
documentation = "test reservation"
duration = 86400
token = "ff:70:81:a9:78:4d"
subnet = "255.255.255.0"
}
`,
ExpectError: regexp.MustCompile("Empty key not allowed"),
Expand Down

0 comments on commit 479bdb5

Please sign in to comment.