-
Notifications
You must be signed in to change notification settings - Fork 96
Move datasource/host
to pkg
#1182
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
base: main
Are you sure you want to change the base?
Conversation
resourceID := info.ResourceID(ctx) | ||
resourceID, err := info.ResourceID(ctx) | ||
if err != nil { | ||
slog.WarnContext(ctx, "Failed to get ResourceID from host info", "error", err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slog.WarnContext(ctx, "Failed to get ResourceID from host info", "error", err.Error()) | |
slog.WarnContext(ctx, "Failed to get ResourceID from host info", "error", err) |
@@ -103,117 +105,146 @@ func NewInfo() *Info { | |||
} | |||
} | |||
|
|||
func (i *Info) IsContainer() bool { | |||
res, err, _ := singleflightGroup.Do(IsContainerKey, func() (interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since single flight has been removed from the functions does something need to be done where they are being called to prevent duplicate function calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's only called once per new resource, so I don't think there's a danger of duplicate calls, AFAIK
Proposed changes
Moves the
internal/datasource/host
topkg
so other teams can use the logic for generating theresource id
.Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTING
documentmake install-tools
and have attached any dependency changes to this pull requestREADME.md
)