pipectl ignores a malformed --label or --labels value and acts on every application

Đang mở
#7,599 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
cli

Hướng nghiên cứu

Start with the pipectl handlers for application list, deployment list, transfer backup, and transfer restore application, then trace where their --label or --labels values are parsed. Check the existing tests for those commands and add coverage for values without a colon, including env=prod. Done means each malformed value produces an error naming the value and does not run the command across every application; the issue author says a fix with tests is already ready.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What happened:

Four pipectl commands take label filters in the form KEY:VALUE, and they skip any value without a colon:

  • pipectl application list --label
  • pipectl deployment list --label
  • pipectl transfer backup --labels
  • pipectl transfer restore application --labels

So --labels=env=prod, or a typo such as --labels=env, silently removes the filter. The command then works on every application, with no warning. For transfer restore application this means restoring all applications in the backup instead of the ones the user selected.

What you expected to happen:

The command fails with an error that says which value is wrong.

How to reproduce it:

pipectl transfer restore application --labels=env=prod \
  --input-file=backup.json --piped-id-mapping-file=mapping.json \
  --address=... --api-key=...

Every application in backup.json is restored.

Environment:

  • piped version: not relevant
  • control-plane version: not relevant
  • Others: pipectl at master (cd72c196)

I'd like to work on this. I have a fix with tests ready: https://github.com/pipe-cd/pipecd/compare/master...itsnjstyle27:pipecd:fix/pipectl-malformed-labels

Ngôn ngữ chính
Go
Star
1.4k
Fork
391
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
58

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pipe-cd/pipecd

Tất cả issue của pipe-cd/pipecd

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.