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

Impl(backend): add pvc data fetch api functionality #259

Merged
merged 6 commits into from
May 7, 2024

Conversation

Tanmay-21
Copy link
Contributor

Implements #258
Closes #258

Description

This PR adds support for fetching PersistentVolumeClaims data on /resource endpoint in cyclops-ctrl.

Copy link
Collaborator

@petar-cvit petar-cvit left a comment

Choose a reason for hiding this comment

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

@Tanmay-21 thanks for the PR. Left one comment for the PVC struct

cyclops-ctrl/internal/models/dto/k8s.go Show resolved Hide resolved
Comment on lines 576 to 577
AccessModes: persistentvolumeclaim.spec.accessModes,
Size: persistentvolumeclaim.spec.resources.requests.storage,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you fix this as well? Also, do we need to checkout for nil pointer dereference if Storage is nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need deleted value populated here as false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also I think storage is a necessary field in PVCs so might never be nil

Copy link
Collaborator

Choose a reason for hiding this comment

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

This does not compile. You should .Spec.AccessModes with capital letters

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also I think storage is a necessary field in PVCs so might never be nil

I was thinking the same thing, but would still like to be cautious since we are dealing with pointers. If its nil, you can default to 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

Copy link
Collaborator

@petar-cvit petar-cvit left a comment

Choose a reason for hiding this comment

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

LGTM

@petar-cvit
Copy link
Collaborator

Thanks @Tanmay-21!

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.

Implement resource details for PersistentVolumeClaims
2 participants