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

Add describe pool command #20

Merged
merged 1 commit into from
May 31, 2021
Merged

Add describe pool command #20

merged 1 commit into from
May 31, 2021

Conversation

ParthS007
Copy link
Collaborator

@ParthS007 ParthS007 commented May 25, 2021

Screenshot 2021-05-30 at 11 46 35 AM

closes #15

@ParthS007 ParthS007 marked this pull request as ready for review May 30, 2021 09:41
}

for _, bd := range BdInfo {
err = util.PrintByTemplate("bd", blockDevicesInfoFromCSPI, bd)
Copy link
Member

Choose a reason for hiding this comment

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

  • PrintByTemplate may not be a good UI/UX as in case of multiple BDs the above will generate something like this:-
Block Device Details :
----------------
Name     : blockdevice-c21bc3b79a98c7e8508f47558cc94f36
Capacity : 107374182400
State   : Active
Block Device Details :
----------------
Name     : blockdevice-c21bc3b79a98c7e8508f47558cc94f36
Capacity : 107374182400
State   : Active

The above should have been like this, similar to kubectl get list.

Block Device Details :
----------------
Name   Capacity  State
bd-1   107641    active 
bd-2   187261    active

You can refer this code for the same:-

if cvrs != nil && len(cvrs.Items) > 0 {

}

for _, cvr := range CVRInfoInPool {
err = util.PrintByTemplate("cvr", provisionedReplicasInfoFromCSPI, cvr)
Copy link
Member

Choose a reason for hiding this comment

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

  • PrintByTemplate may not be a good UI/UX as in case of multiple CVRs the above will generate something like this:-
Provisioned Replicas Details :
----------------
Name     : pvc-b84f60ae-3f26-4110-a85d-bce7ec00dacc-default-cstor-disk-dcrm
PVC Name : mongo
Size     : 1.04G
Status	 : Healthy
Provisioned Replicas Details :
----------------
Name     : pvc-b84f60ae-3f26-4110-a85d-bce7ec00dacc-default-cstor-disk-dcrm
PVC Name : mongo
Size     : 1.04G
Status	 : Healthy

The above should have been like this, similar to kubectl get list.

Provisioned Replicas Details :
----------------
Name   PvcName  Size    Status
cvr-1  pvc-1    107641  Healthy 
cvr-2  pvc-2    187261  Degraded

You can refer this code for the same:-

if cvrs != nil && len(cvrs.Items) > 0 {

----------------
Name : {{.Name}}
Capacity : {{.Capacity}}
State : {{.State}}
Copy link
Member

@Abhinandan-Purkait Abhinandan-Purkait May 31, 2021

Choose a reason for hiding this comment

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

  • Indentation is a bit off here.
    You can ignore this comment if the above comments are addressed.

poolInfoCommandHelpText = `
This command fetches information and status of the various aspects
of the cStor Pool Instance and its underlying related resources in the provided namespace.
If no namespace is provided it uses default namespace for execution.
Copy link
Member

Choose a reason for hiding this comment

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

  • Please change the line to If no namespace is provided it uses openebs namespace for execution.

This command fetches information and status of the various aspects
of the cStor Pool Instance and its underlying related resources in the provided namespace.
If no namespace is provided it uses default namespace for execution.
$ kubectl openebs describe pool [cspi-name] -n [namespace]
Copy link
Member

Choose a reason for hiding this comment

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

Please change the namespace word to openebs ns
$ kubectl openebs describe pool [cspi-name] -n [openebs ns]

Copy link
Member

@vharsh vharsh left a comment

Choose a reason for hiding this comment

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

lgtm

@vharsh
Copy link
Member

vharsh commented May 31, 2021

@ParthS007 Please send in a new PR to ACK these review comments.

@vharsh vharsh merged commit c616588 into openebs:master May 31, 2021
@ParthS007 ParthS007 deleted the decribe-pool branch May 31, 2021 15:40
@avishnu
Copy link
Member

avishnu commented Jun 1, 2021

Line no. 297 in k8s.go has repeated 'while' text. Please rectify the same.

@avishnu
Copy link
Member

avishnu commented Jun 1, 2021

Line no. 297 in k8s.go has repeated 'while' text. Please rectify the same.

Line no. 306 as well.

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.

Support command openebsctl pool describe
4 participants