Skip to content

[FS-1537]Component/Update create errors #215

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

Merged
merged 1 commit into from
Jun 20, 2024
Merged

[FS-1537]Component/Update create errors #215

merged 1 commit into from
Jun 20, 2024

Conversation

Alva8756
Copy link
Contributor

What does this PR do

This PR fix the error

{"level":"info","ts":1718785815.973932,"caller":"syslog/receiver.go:113","msg":"host=172.18.192.31 facility=daemon severity=INFO app-name=runner-3623e994-636b-4ed5-b68b-7f748e6a2372 procid=3013 msg=\"{\\\"level\\\":\\\"error\\\",\\\"msg\\\":\\\"1 error occurred:\\\\n\\\\t* Server Component create/update error: CreateComponents: hollow client received a server error - response code: 400, message: , details: models: unable to insert into server_components: pq: duplicate key value violates unique constraint \\\\\\\"idx_server_components\\\\\\\": inventory query returned error: inventory query returned error: inventory query returned error\\\\n\\\\n\\\",\\\"time\\\":\\\"2024-06-19T08:30:15Z\\\"}\\r\\n\"","service":"github.com/tinkerbell/boots","pkg":"syslog"}

When creating components for test server.

without the code, the serial number of power supply will be "To Be Filled By O.E.M." which will duplicate with other power supply.

How can this change be tested by a PR reviewer?

Added the tests in Test_ToComponentSlice by adding a new psu there with serial number as "To Be Filled By O.E.M" and test will catch it becomes 2 to prevent the duplicate.

@joelrebel
Copy link
Member

Thanks for the fixes !!

@joelrebel joelrebel merged commit 19b98e6 into main Jun 20, 2024
8 of 9 checks passed
@joelrebel joelrebel deleted the fs-1537 branch June 20, 2024 09:06
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.

2 participants