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

ngctl: add check command and doc #39

Merged
merged 12 commits into from
Jul 14, 2021
Merged

ngctl: add check command and doc #39

merged 12 commits into from
Jul 14, 2021

Conversation

kqzh
Copy link
Contributor

@kqzh kqzh commented Jul 6, 2021

  • add check command
  • support list command to list nebulacluster sub resources
  • add ngctl doc
  • add unit test

@kqzh kqzh added the type/feature req Type: feature request label Jul 6, 2021
@kqzh kqzh requested review from MegaByte875 and veezhang July 6, 2021 05:16
@CLAassistant
Copy link

CLAassistant commented Jul 6, 2021

CLA assistant check
All committers have signed the CLA.

@kqzh kqzh linked an issue Jul 6, 2021 that may be closed by this pull request
@veezhang veezhang added the ready-for-testing Progress: ready for the CI test label Jul 6, 2021
@@ -0,0 +1,89 @@

# Overview
ngctl is a terminal cmd tool for nebula-operator, it has the following commands:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this better? for nebula-operator sounds like management nebula-operator.

ngctl is a terminal cmd tool for Nebula Graph managed by nebula-operator, it has the following commands:

# specify a nebula cluster to use
ngctl use demo-cluster

# specify kubernetes context and namespace
Copy link
Contributor

@veezhang veezhang Jul 13, 2021

Choose a reason for hiding this comment

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

I thanks this is just specify namespace, and don't support specify kubernetes context now.

Please remove the kubernetes context as well as in go source file.

Namespace string
NebulaClusterName string
ResourceType string
AllNamespaces bool
Copy link
Contributor

Choose a reason for hiding this comment

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

unused

ngctl check pods --nebulacluster=nebula`)
)

const resourceType = "nebulacluster"
Copy link
Contributor

Choose a reason for hiding this comment

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

It's also need in 'list.go', share it?

if o.ResourceType == "" {
o.ResourceType = resourceType
}

Copy link
Contributor

Choose a reason for hiding this comment

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

It is need to check the o.ResourceType ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If user don't specify the resourceType, we can use "nebulacluster" as a default type

},
factory: &factoryImpl{
nebulaClusterName: "",
nebulaClusterConfigFile: "~/.kube/config1",
Copy link
Contributor

@veezhang veezhang Jul 13, 2021

Choose a reason for hiding this comment

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

It is recommended to put it in a temporary directory os.CreateTemp .
And remove it after tested.

As well as config_test.go.

Comment on lines 39 to 41
// GetNebulaClusterName() (string, error)
GetNebulaClusterName() (string, error)
// GetNebulaClusterNameWithoutConfig() string
// GetNamespace() (string, error)
GetNamespace() (string, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

GetNebulaClusterName and GetNamespace may cause out of sync, can you use GetNebulaClusterNameAndNamespace instead?

@kqzh
Copy link
Contributor Author

kqzh commented Jul 13, 2021

@veezhang Fixed all

Copy link
Contributor

@veezhang veezhang left a comment

Choose a reason for hiding this comment

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

LGTM

@veezhang veezhang merged commit c9ff3be into vesoft-inc:master Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing Progress: ready for the CI test type/feature req Type: feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ngctl cmd tool
3 participants