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

pipeline: complete pipeline list cli #534

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

Xieql
Copy link
Contributor

@Xieql Xieql commented Jan 2, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

part of #533

here shows how to use it

root@xql:~/go/src/kurator.dev/kurator# kurator pipeline execution list -h
list the kurator pipeline execution

Usage:
  kurator pipeline execution list [flags]

Examples:
  # List kurator pipeline objects in the default namespace
  kurator pipeline execution list

  # List the pipelines in a specific namespace (replace 'example-namespace' with your namespace)
  kurator pipeline execution list -n example-namespace

  # List the pipelines across all namespaces
  kurator pipeline execution list -A

Flags:
  -A, --all-namespaces     If true, list the pipelineRuns across all namespaces
  -h, --help               help for list
  -n, --namespace string   specific namespace (default "default")

Global Flags:
      --context string           name of the kubeconfig context to use
      --dry-run                  console/log output only, make no changes.
      --home-dir string          install path, default to $HOME/.kurator (default "/root/.kurator")
  -c, --kubeconfig string        path to the kubeconfig file, default to karmada apiserver config (default "/etc/karmada/karmada-apiserver.config")
      --wait-interval duration   interval used for checking pod ready, default value is 1s. (default 1s)
      --wait-timeout duration    timeout used for checking pod ready, default value is 2m. (default 2m0s)
root@xql:~/go/src/kurator.dev/kurator# kurator pipeline execution list --kubeconfig /root/.kube/kurator-host.config
------------------------------------- Pipeline Execution -----------------------------
  Execution Name          |   Creation Time     |   Namespace      | Creator Pipeline
--------------------------------------------------------------------------------------
root@xql:~/go/src/kurator.dev/kurator# kurator pipeline execution list --kubeconfig /root/.kube/kurator-host.config -n kurator-pipeline
------------------------------------- Pipeline Execution -----------------------------
  Execution Name          |   Creation Time     |   Namespace      | Creator Pipeline
--------------------------------------------------------------------------------------
quick-start-run-frb7l     | 2023-12-26 16:59:55  | kurator-pipeline | quick-start
quick-start-run-h65wx     | 2023-12-29 16:14:07  | kurator-pipeline | quick-start
root@xql:~/go/src/kurator.dev/kurator# kurator pipeline execution list --kubeconfig /root/.kube/kurator-host.config -n test-ns
------------------------------------- Pipeline Execution -----------------------------
  Execution Name          |   Creation Time     |   Namespace      | Creator Pipeline
--------------------------------------------------------------------------------------
root@xql:~/go/src/kurator.dev/kurator# kurator pipeline execution list --kubeconfig /root/.kube/kurator-host.config -A
------------------------------------- Pipeline Execution -----------------------------
  Execution Name          |   Creation Time     |   Namespace      | Creator Pipeline
--------------------------------------------------------------------------------------
quick-start-run-frb7l     | 2023-12-26 16:59:55  | kurator-pipeline | quick-start
quick-start-run-h65wx     | 2023-12-29 16:14:07  | kurator-pipeline | quick-start

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Copy link

netlify bot commented Jan 2, 2024

Deploy Preview for kurator-dev ready!

Name Link
🔨 Latest commit 3a2cef5
🔍 Latest deploy log https://app.netlify.com/sites/kurator-dev/deploys/6594b9ab8c43840008a9a840
😎 Deploy Preview https://deploy-preview-534--kurator-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Xieql Xieql force-pushed the pipeline-cli-list branch from d823b07 to 7bab2db Compare January 2, 2024 08:26
)

func NewCmd(opts *generic.Options) *cobra.Command {
joinCmd := &cobra.Command{
Copy link
Member

Choose a reason for hiding this comment

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

s/joinCmd/{more appropriate name}

Copy link
Contributor Author

@Xieql Xieql Jan 3, 2024

Choose a reason for hiding this comment

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

ok

"kurator.dev/kurator/pkg/pipeline/execution/list"
)

var Args = list.Args{}
Copy link
Member

Choose a reason for hiding this comment

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

why make it global

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should not be a global var

)

func NewCmd(opts *generic.Options) *cobra.Command {
joinCmd := &cobra.Command{
Copy link
Member

Choose a reason for hiding this comment

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

rename

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


pipelineRunList := &tektonapi.PipelineRunList{}
if err := p.CtrlRuntimeClient().List(context.Background(), pipelineRunList, listOpts); err != nil {
fmt.Fprintf(os.Stderr, "failed to get PipelineRunList: %v\n", err)
Copy link
Member

Choose a reason for hiding this comment

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

logrus.Errorf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Signed-off-by: Xieql <[email protected]>
Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@kurator-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kurator-bot kurator-bot merged commit 5d05d4e into kurator-dev:main Jan 3, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants