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

Add Validation of hardware data before pushing it to avoid duplication of mac addresses in the database #204

Closed
parauliya opened this issue Jul 3, 2020 · 0 comments · Fixed by #205
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@parauliya
Copy link
Contributor

Expected Behaviour

If someone tries to push the hardware data which contains a mac address which is already present in the database, the API will fail with the error explaining that "this mac address is already present in the database.

Current Behaviour

Currently there is no validation for this so a if user tries to push a hardware data which contains a mac which is already present in the data base, a new hardware data entry will be created with a mac address which is already present in the database which will lead to have a duplication of MAC addresses in the database. After this validation that hardware data will not be allowed to push which has a mac address which is already present in the database.

Possible Solution

Add a validation before pushing the hardware data where you can check for all the MAC address present in the hardware data that if there is any entry for any of the mac address of hardware data and if there is an enrtry found this hardware data is not allowed to be pushed in the database.

Your Environment

  • Operating System and version (Linux, Windows, MacOS).
    Each and every OS
  • How are you running Tinkerbell? Using Vagrant & VirtualBox, Vagrant & Libvirt, on Packet using Terraform, or give details:
    In any of the above environment this issue will occur.
@parauliya parauliya self-assigned this Jul 3, 2020
@parauliya parauliya added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 3, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 3, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 6, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 6, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 6, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 7, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 8, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 8, 2020
gauravgahlot pushed a commit that referenced this issue Jul 9, 2020
…s in the hardware database (#205)

* Fix issue #204: Added validation to avoid duplication of mac addresses in the hardware database

* Incorporate review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
1 participant