Skip to content

Commit

Permalink
refactor: update files
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Nov 11, 2024
1 parent 9adcb6c commit dae411b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/floatingip/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ func getFloatingIPAttributes(f *hcloud.FloatingIP) map[string]interface{} {
return res
}

func setProtection(ctx context.Context, c *hcloud.Client, f *hcloud.FloatingIP, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, f *hcloud.FloatingIP, deleteProtection bool) error {
action, _, err := c.FloatingIP.ChangeProtection(ctx, f,
hcloud.FloatingIPChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/loadbalancer/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ func algorithmToTerraformAlgorithm(algorithm hcloud.LoadBalancerAlgorithm) (tfAl
return
}

func setProtection(ctx context.Context, c *hcloud.Client, lb *hcloud.LoadBalancer, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, lb *hcloud.LoadBalancer, deleteProtection bool) error {
action, _, err := c.LoadBalancer.ChangeProtection(ctx, lb,
hcloud.LoadBalancerChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/network/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ func getNetworkAttributes(n *hcloud.Network) map[string]interface{} {
}
}

func setProtection(ctx context.Context, c *hcloud.Client, n *hcloud.Network, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, n *hcloud.Network, deleteProtection bool) error {
action, _, err := c.Network.ChangeProtection(ctx, n,
hcloud.NetworkChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/primaryip/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ func getPrimaryIPAttributes(f *hcloud.PrimaryIP) map[string]interface{} {
return res
}

func setProtection(ctx context.Context, c *hcloud.Client, primaryIP *hcloud.PrimaryIP, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, primaryIP *hcloud.PrimaryIP, deleteProtection bool) error {
action, _, err := c.PrimaryIP.ChangeProtection(ctx,
hcloud.PrimaryIPChangeProtectionOpts{
ID: primaryIP.ID,
Delete: delete,
Delete: deleteProtection,
},
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/volume/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ func getVolumeAttributes(v *hcloud.Volume) map[string]interface{} {
return res
}

func setProtection(ctx context.Context, c *hcloud.Client, v *hcloud.Volume, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, v *hcloud.Volume, deleteProtection bool) error {
action, _, err := c.Volume.ChangeProtection(ctx, v,
hcloud.VolumeChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down

0 comments on commit dae411b

Please sign in to comment.