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

feat(client-wrapper): Adds support for CStorPool (#46) #52

Merged
merged 6 commits into from
Oct 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions utils/k8s/openebscrd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,22 @@ func (k8s K8S) DeleteStoragePoolClaim(spcName string) error {
spcClient := k8s.OpenebsClientSet.Openebs().StoragePoolClaims()
return spcClient.Delete(spcName, &meta_v1.DeleteOptions{})
}

// GetCStorPool returns the CStorPool object for given cStorPoolName.
// :return: *openebs_v1.CStorPool: Pointer to CStorPool objects.
Copy link
Contributor

Choose a reason for hiding this comment

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

@aswathkk
We might not require this line(45):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

func (k8s K8S) GetCStorPool(cStorPoolName string) (*openebs_v1.CStorPool, error) {
cStorPoolClient := k8s.OpenebsClientSet.OpenebsV1alpha1().CStorPools()
return cStorPoolClient.Get(cStorPoolName, meta_v1.GetOptions{})
}

// ListCStorPool returns all CStorPool objects.
func (k8s K8S) ListCStorPool() (*openebs_v1.CStorPoolList, error) {
cStorPoolClient := k8s.OpenebsClientSet.OpenebsV1alpha1().CStorPools()
return cStorPoolClient.List(meta_v1.ListOptions{})
}

// DeleteCStorPool deletes a CStorPool with the given name.
func (k8s K8S) DeleteCStorPool(cStorPoolName string) error {
cStorePoolClient := k8s.OpenebsClientSet.OpenebsV1alpha1().CStorPools()
return cStorePoolClient.Delete(cStorPoolName, &meta_v1.DeleteOptions{})
}