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

fix(814) Add instance disks resource to linode #911

Merged
merged 7 commits into from
Sep 12, 2023

Conversation

titanventura
Copy link
Contributor

Problem

Support instance disks - Linode

Solution

Added instance disks to the list of resources under linodes function.

Changes Made

  • Modified the linode provider to include instance disks

Checklist

Reviewers

@jakepage91 @mlabouardy

fixes #814

@mlabouardy
Copy link
Collaborator

@AvineshTripathi @ShubhamPalriwala wdyt?

}

log.WithFields(log.Fields{
"provider": "Linode",
"account": client.Name,
"service": "Linode",
"service": "Linode and Instance Disk",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"service": "Linode and Instance Disk",
"service": "Linode Instance and Instance Disk",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Usually, they call linode instances as linodes. But if linode instance and instance disk seems to sound good, we can go with that !
WDYT ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll leave it upto you if you say so I dont mind. Also did you check it in dashboard if the Linodes and Instance disks are separetly created as two different entity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, I think it won't be displayed in the dashboard because the FetchDataFunction for Linode is actually commented out, IDK why

Reference:

// compute.LinodeInstancesAndInstanceDisks,

Copy link
Collaborator

Choose a reason for hiding this comment

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

You would have to uncomment that

resources = append(resources, models.Resource{
Provider: "Linode",
Account: client.Name,
Service: "Instance Disk",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we rename this to Linodes Instance disk as the Service field is generally showed on Komiser dashboard, so do you think specifying is better?

Copy link
Contributor

@ShubhamPalriwala ShubhamPalriwala left a comment

Choose a reason for hiding this comment

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

Hey @titanventura, the PR looks good to me! I just think you forgot to call the service so once that is fixed, we can merge the PR!

"github.com/tailwarden/komiser/providers/linode/storage"
"github.com/uptrace/bun"
)

func listOfSupportedServices() []providers.FetchDataFunction {
return []providers.FetchDataFunction{
// compute.Linodes,
// compute.LinodeInstancesAndInstanceDisks,
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you forget to uncomment this?

Copy link
Contributor Author

@titanventura titanventura Aug 27, 2023

Choose a reason for hiding this comment

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

this line was commented before i started working on this PR, i changed the name of the function so made changes to this line as well, anyways the problem is that compute.Linodes or compute.LinodeInstancesAndInstanceDisks does not comply with providers.FetchDataFunction interface, because of the third parameter !

Copy link
Collaborator

Choose a reason for hiding this comment

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

any update on fixing this @titanventura ?

@titanventura
Copy link
Contributor Author

Enabled the FetchData function for Instance and Instance disks and also implemented changes suggested in comments.

Please review @AvineshTripathi @mlabouardy @ShubhamPalriwala .

Also, had one more suggestion, currently, the instance disks are dependant on the instance resources in linode, as a result of this, the fetching of instance disks happens synchronously, should we have an option in komiser that enables concurrent fetching of nested reources. If we implement this, a similar pattern can be followed for other nested resources as well. Adding some concurrency would improve the fetching speed. Just a suggestion, if approved, would be happy to try this in a separate PR for the same resource. :)

@AvineshTripathi
Copy link
Collaborator

Hey @titanventura we are currently looking to redesign the arch of komiser where one of most important things to add is concurrent fetching of resources. If you are willing to help me with brainstorming how we do that all together would definitely like to collaborate.

@titanventura
Copy link
Contributor Author

For sure @AvineshTripathi , I'd be more than happy to collaborate!

Copy link
Collaborator

@mlabouardy mlabouardy left a comment

Choose a reason for hiding this comment

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

LGTM!

@mlabouardy mlabouardy merged commit df7e197 into tailwarden:develop Sep 12, 2023
2 checks passed
@mlabouardy mlabouardy added this to the v3.1.1 milestone Sep 12, 2023
@AvineshTripathi
Copy link
Collaborator

hey @titanventura can yo dm me over discord n we connect n work on arch/

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.

Support Linode Instance disks
4 participants