-
Notifications
You must be signed in to change notification settings - Fork 631
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
Replace ids with checksum of the resource ids #869
Replace ids with checksum of the resource ids #869
Conversation
Decided this made no sense and merged the sort and sha. |
Thanks but we already have |
For sure, I did not notice there was one already, ill update this to use
that function.
…On Thu, Nov 12, 2020, 8:13 PM Jacob Bednarz ***@***.***> wrote:
Thanks but we already have stringChecksum for this purpose. Are you able
to update this PR to use that function instead?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#869 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACLS7CIS6HFXVWHV6P27MSLSPQXWJANCNFSM4TTSJS3A>
.
|
@jacobbednarz I reused the checksum function but kept the wrapper function to make the list -> checksum, in order to avoid repeating the |
@@ -110,6 +109,7 @@ func dataSourceCloudflareWAFGroupsRead(d *schema.ResourceData, meta interface{}) | |||
} | |||
|
|||
log.Printf("[DEBUG] Reading WAF Groups") | |||
groupIds := make([]string, 0) |
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.
I can't see where we are append
ing to this slice. Am I missing it?
@@ -96,6 +95,7 @@ func dataSourceCloudflareWAFPackagesRead(d *schema.ResourceData, meta interface{ | |||
} | |||
|
|||
log.Printf("[DEBUG] Reading WAF Packages") | |||
packageIds := make([]string, 0) |
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.
@@ -119,6 +118,7 @@ func dataSourceCloudflareWAFRulesRead(d *schema.ResourceData, meta interface{}) | |||
} | |||
|
|||
log.Printf("[DEBUG] Reading WAF Rules") | |||
ruleIds := make([]string, 0) |
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.
I think the dedicated |
@jacobbednarz Good catch, I completely missed it when copy/pasting this from one data source to another. I believe I covered them all now. |
Awesome, thanks @pecigonzalo! You rock 🤘 |
Can you release a patch version with this please? |
Probably not right away - we generally release on a monthly basis unless there are pressing fixes included in it. There are a couple of PRs in flight we'll be looking to include in the next release. |
Fixes: #764
I was not sure if you would prefer to use
sha1
or some other function, but I think this should get the job done.I chose to leave
generateShaId
as a separate function but repeatsort
and.join
because I thought there could be non list ids we could want to produce a sha for, but then noticed we do not. I think leaving it reusable its not bad, but let me know if this is not your preferred choice.