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

feat: Add import capability to resource ovh_ip_firewall_rule #797

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

amstuta
Copy link
Contributor

@amstuta amstuta commented Jan 6, 2025

Description

Fixes #795

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Test A: make testacc TESTARGS="-run TestAccIPFirewallRule_basic"

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran succesfully go mod vendor if I added or modify go.mod file

@@ -47,6 +53,26 @@ func (d *ipFirewallRuleResource) Schema(ctx context.Context, req resource.Schema
resp.Schema = IpFirewallRuleResourceSchema(ctx)
}

func (r *ipFirewallRuleResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
splits := strings.Split(req.ID, "|")
if len(splits) < 3 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if len(splits) < 3 {
if len(splits) != 3 {

@amstuta amstuta force-pushed the dev/aamstutz/ip-firewall-rule-import branch from 2a40b1c to 81daf97 Compare January 6, 2025 15:22
@amstuta amstuta merged commit 4d78720 into master Jan 6, 2025
@deathiop deathiop deleted the dev/aamstutz/ip-firewall-rule-import branch January 6, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add firewall rule import
3 participants