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

common: fix random number generator #541

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

Vicente-Cheng
Copy link
Contributor

Problem:
side-effect from 1069a0c

Solution:
Use the correct random function

Related Issue:

Test plan:

Copy link
Member

@bk201 bk201 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@Vicente-Cheng
Copy link
Contributor Author

Hi all,
We use the random number generator on harvester-installer, node-manager and node-disk-manager.
So I prefer to wrap this into a common function and add a unit test.
This is the wrapper PR harvester/go-common#5

Change this to draft, I will use this common function after the above PR is merged

@Vicente-Cheng Vicente-Cheng marked this pull request as draft July 14, 2023 10:45
    This is the side-effect from 1069a0c,
    the `Sign()` only return sign or not.

    Use wrapper function `GenRandNumber` to get the random number

Signed-off-by: Vicente Cheng <[email protected]>
@Vicente-Cheng Vicente-Cheng force-pushed the fix-rand-number-output branch from e82f284 to 6d7cf62 Compare July 18, 2023 02:15
@Vicente-Cheng Vicente-Cheng marked this pull request as ready for review July 18, 2023 02:19
@Vicente-Cheng
Copy link
Contributor Author

Hi all, update to using the wrapper function from go-common.
Please help to review it again.

@Vicente-Cheng Vicente-Cheng requested a review from bk201 July 18, 2023 02:19
@guangbochen guangbochen removed the request for review from yaocw2020 July 18, 2023 02:27
Copy link
Member

@bk201 bk201 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@guangbochen guangbochen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@guangbochen guangbochen merged commit 7027f89 into harvester:master Jul 18, 2023
@guangbochen
Copy link
Contributor

@mergify backport v1.2

@mergify
Copy link

mergify bot commented Jul 18, 2023

backport v1.2

✅ Backports have been created

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.

4 participants