Skip to content

Conversation

@thaJeztah
Copy link
Member

This uuid package was introduced in 89db01e (#4889), but we want to reduce dependency on the old docker/distribution module.

Replace it with google/uuid, which is a commonly used module for this and already a dependency.

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

This uuid package was introduced in 89db01e,
but we want to reduce dependency on the old docker/distribution module.

Replace it with google/uuid, which is a commonly used module for this
and already a dependency.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 28.0.2 milestone Mar 3, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 59.34%. Comparing base (3f154ad) to head (fda7da2).
Report is 2 commits behind head on master.

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5879      +/-   ##
==========================================
+ Coverage   59.32%   59.34%   +0.02%     
==========================================
  Files         353      353              
  Lines       29731    29731              
==========================================
+ Hits        17637    17645       +8     
+ Misses      11112    11103       -9     
- Partials      982      983       +1     

// OTEL processors may think the same process is restarting
// continuously.
semconv.ServiceInstanceID(uuid.Generate().String()),
semconv.ServiceInstanceID(uuid.NewString()),
Copy link
Member Author

Choose a reason for hiding this comment

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

I should mention that in theory, uuid.NewString() could panic, but I think chances for this to happen are really exceptional, and it's probably fine to just panic in that case;

// NewString creates a new random UUID and returns it as a string or panics.
// NewString is equivalent to the expression
//
// uuid.New().String()
func NewString() string {
return Must(NewRandom()).String()
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Alternatively we could do NewRandom(), check the error, and ignore it, but not sure if that's good.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, and existing code also could panic, so I think this comment can be ignored, as it doesn't change anything from that perspective;

// Any other errors represent a system problem. What did someone
// do to /dev/urandom?
panic(fmt.Errorf("error reading random number generator, retried for %v: %v", totalBackoff.String(), err))

@thaJeztah thaJeztah requested a review from Benehiko March 3, 2025 10:50
@thaJeztah thaJeztah merged commit 124716b into docker:master Mar 3, 2025
110 checks passed
@thaJeztah thaJeztah deleted the google_uuid branch March 3, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants