mirror of
https://github.com/goodhosts/cli.git
synced 2026-04-27 07:06:00 +03:00
[GH-ISSUE #12] Goodhosts don't remove duplicates #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Mte90 on GitHub (Sep 1, 2020).
Original GitHub issue: https://github.com/goodhosts/cli/issues/12
Originally assigned to: @luthermonson on GitHub.
We are facing some issues with the vagrant plugin that when we add new hosts, they are added creating things like:
@luthermonson commented on GitHub (Sep 5, 2020):
hi @Mte90 ran some scenarios in my head while walking through code and im not sure how you ended up getting this result. if you look here: https://github.com/goodhosts/hostsfile/blob/master/hosts.go#L117 it skips dupes in the hostsfile library and here: https://github.com/goodhosts/cli/blob/master/cmd/add.go#L37-L43 in the cli it pulls dupes from the args passed.
even the remove call should take out dupes... any ideas how this could have happened? I'm currently at a loss.
@Mte90 commented on GitHub (Sep 7, 2020):
Hi @luthermonson we saw various users of the vagrant plugin with the issue.
The plugin run add on boot and remove on halt but can happen that you turn of the host machine without turning off the virtual machine so the remove command is not executed.
The fact that identify the right ip address and enqueue them is good but is not detecting in the line that domain already exists so it is appended anyway. Maybe the issue is in the domain detection in a long line?
I think that you can do some tests with that line that I shared to you but I am here for debugging also to compile the tool if needed.
@luthermonson commented on GitHub (Sep 7, 2020):
i added a clean command and ran it across your line and it improves things, perhaps we can run this before every flush in add/remove. Give it a try: https://github.com/goodhosts/cli/releases/tag/v1.0.4
@luthermonson commented on GitHub (Sep 7, 2020):
I just can't seem to get the add to not strip out dupes.
@Mte90 commented on GitHub (Sep 8, 2020):
Seems that clean that line rightly, this command can be executed on adding/removing?
@Mte90 commented on GitHub (Sep 24, 2020):
any updates?
@luthermonson commented on GitHub (Oct 15, 2020):
Sorry for delay, v1.0.5 now has all this.
@Mte90 commented on GitHub (Oct 15, 2020):
Hi @luthermonson, it is not clear to me a thing.
It is possible to do the clean on adding or remove? I am trying just to optimize the thing and avoid executing 2 commands.
@luthermonson commented on GitHub (Oct 15, 2020):
yes, there is a
--cleanor-cyou can use on add/remove now@Mte90 commented on GitHub (Oct 15, 2020):
Ok so I can combine them in the same command.
Thanks