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

Topograph model import for use with toposim #15

Merged
merged 10 commits into from
Oct 25, 2024
Merged

Topograph model import for use with toposim #15

merged 10 commits into from
Oct 25, 2024

Conversation

henryh2
Copy link
Collaborator

@henryh2 henryh2 commented Oct 24, 2024

This MR adds functionality for topograph to import a cluster model from a file to be use with toposim.

Signed-off-by: Henry Haase <[email protected]>
Signed-off-by: Henry Haase <[email protected]>
Signed-off-by: Henry Haase <[email protected]>
cmd/topograph/main.go Outdated Show resolved Hide resolved
@henryh2 henryh2 merged commit 7ce1be9 into main Oct 25, 2024
4 checks passed
@henryh2 henryh2 deleted the test-model branch October 25, 2024 18:38
Copy link
Collaborator

@pkedy pkedy left a comment

Choose a reason for hiding this comment

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

We need to start putting more comments on public funcs. One small nit.

} else {
model, err := models.NewModelFromFile(modelPath)
if err != nil {
return nil, err
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: You unless properly wrapped by models.NewModelFromFile, you'll want to wrap this error with

fmt.Errorf("could not read model file: %w", err)

If models.NewModelFromFile(modelPath) DOES wrap the error, I would just add a comment

return nil, err // Wrapped by models.NewModelFromFile

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.

3 participants