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 logic for openebs namespace determination from cli code #21

Merged
merged 4 commits into from
Jun 2, 2021

Conversation

Abhinandan-Purkait
Copy link
Member

@Abhinandan-Purkait Abhinandan-Purkait commented Jun 2, 2021

What does this PR do?

  • This PR adds logic to determine the openebs namespace using the cas-type from engine specific components.
  • This PR solves the problem of existence two namespaces, by determining one from the code itself.
  • This PR also adds a flag openebs-namespace which can allow user to enter the namespace by himself in case the logic fails.
  • Currently the logic is made to work for cstor only.

The new flag

❯ kubectl openebs describe pvc -h

Flags:
  -h, --help                       help for pvc
      --openebs-namespace string   to read the openebs namespace from user.
                                   If not provided it is determined from components.

Usage:-

kubectl openebs describe pvc cstor-vol-1 cstor-vol-2 -n storage --openebs-namespace=openebs

Closes #18

Signed-off-by: Abhinandan-Purkait <abhinandan.purkait@mayadata.io>
Signed-off-by: Abhinandan-Purkait <abhinandan.purkait@mayadata.io>
Signed-off-by: Abhinandan-Purkait <abhinandan.purkait@mayadata.io>
@Abhinandan-Purkait Abhinandan-Purkait requested a review from vharsh June 2, 2021 14:34
@Abhinandan-Purkait Abhinandan-Purkait self-assigned this Jun 2, 2021
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.

Awesome PR, just a minor code simplification suggestion

kubectl-openebs/cli/util/k8s_utils.go Outdated Show resolved Hide resolved
kubectl-openebs/cli/command/describe/pvc_info.go Outdated Show resolved Hide resolved
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, had minor suggestions

@vharsh vharsh merged commit 1d0d034 into openebs:master Jun 2, 2021
@Abhinandan-Purkait Abhinandan-Purkait deleted the ns-issue branch June 17, 2021 04:53
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.

Determine openebs ns from the CLI.
2 participants