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

Fix CreateOrUpdate needs the record name #1341

Merged

Conversation

frankywahl
Copy link
Contributor

For now, it was failing because we were not passing the name to the record to be created if it was not present.

Description

Make the CLI act as expected in create-or-update when no records are found

Has your change been tested?

Yes - ran it against a host I have

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented in cloudflare/api-schemas
    and relies on stable APIs.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 20, 2023

changelog detected ✅

For now, it was failing because we were not passing the name to the
record to be created if it was not present.
rr.Proxied = &proxy
rr.Priority = &priority
rr := cloudflare.CreateDNSRecordParams{
Name: name,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the initialisation to make it match the dnsCreate method. The key change to fix the bug is line 118, now because the name was not being sent to create which would create a DNS Validation Error (1004)

Proxied: &proxy,
Priority: &priority,
}

// TODO: Print the response.
Copy link
Contributor Author

@frankywahl frankywahl Jul 20, 2023

Choose a reason for hiding this comment

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

I think this TODO (see writeTable function call below) can be removed - but is unrelated to this PR.

@@ -0,0 +1,3 @@
```release-note:bug
dns: allow for create or update to actually create the record
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dns: allow for create or update to actually create the record
flarectl: allow for create or update to actually create the record

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2023

Codecov Report

Merging #1341 (2a36b48) into master (b9ac804) will increase coverage by 0.08%.
The diff coverage is 58.14%.

@@            Coverage Diff             @@
##           master    #1341      +/-   ##
==========================================
+ Coverage   48.33%   48.42%   +0.08%     
==========================================
  Files         133      134       +1     
  Lines       13023    13104      +81     
==========================================
+ Hits         6295     6345      +50     
- Misses       5201     5220      +19     
- Partials     1527     1539      +12     
Impacted Files Coverage Δ
device_posture_rule.go 61.80% <ø> (ø)
load_balancing.go 59.40% <ø> (ø)
teams_accounts.go 53.84% <ø> (ø)
regional_tiered_cache.go 43.75% <43.75%> (ø)
logpush.go 51.81% <46.15%> (-0.30%) ⬇️
images.go 44.70% <47.82%> (-0.12%) ⬇️
rulesets.go 30.03% <52.17%> (-4.61%) ⬇️
pages_deployment.go 38.88% <61.76%> (+4.64%) ⬆️
pages_project.go 58.22% <90.00%> (+7.40%) ⬆️
access_policy.go 70.27% <100.00%> (ø)
... and 1 more

@jacobbednarz jacobbednarz merged commit 34405ab into cloudflare:master Jul 28, 2023
@github-actions github-actions bot added this to the v0.74.0 milestone Jul 28, 2023
github-actions bot pushed a commit that referenced this pull request Jul 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

This functionality has been released in v0.74.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2023
@frankywahl frankywahl deleted the fix-create-or-update branch August 3, 2023 07:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants