Skip to content

Add scanner cmd#396

Merged
Vad1mo merged 28 commits into
goharbor:mainfrom
rizul2108:scanner-cmd
May 13, 2025
Merged

Add scanner cmd#396
Vad1mo merged 28 commits into
goharbor:mainfrom
rizul2108:scanner-cmd

Conversation

@rizul2108

Copy link
Copy Markdown
Collaborator

Description

This pull request continues the work initiated in #109

Changes and Improvements

muaz-32 and others added 16 commits June 4, 2024 20:05
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
… the creation of the scanner.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Co-authored-by: Aman <136564604+amands98@users.noreply.github.com>
Signed-off-by: Muazul Islam <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
… for auth type.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
…teraction.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
@rizul2108

Copy link
Copy Markdown
Collaborator Author

image
@bupd,
The createScanner API is consistently returning an Internal Server Error.
Could you please help identify the reason behind this?

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
@bupd

bupd commented Apr 13, 2025

Copy link
Copy Markdown
Member

@bupd, The createScanner API is consistently returning an Internal Server Error. Could you please help identify the reason behind this?

try setting use_internal_addr to true. or use a valid scanner.

@rizul2108

Copy link
Copy Markdown
Collaborator Author

image
still same
is url being tested first?

@bupd bupd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

output yaml/json is not working for view.

./habor-cli scanner list -o yaml doesn't return yaml output.

Comment thread cmd/harbor/root/cmd.go Outdated
Comment thread pkg/views/scanner/view/view.go Outdated
Comment thread pkg/views/scanner/view/view.go Outdated
Comment thread pkg/views/scanner/view/view.go Outdated
Comment thread pkg/views/scanner/list/view.go Outdated
Comment thread cmd/harbor/root/scanner/metadata.go
rizul2108 and others added 2 commits April 13, 2025 20:31
Co-authored-by: Prasanth Baskar <bupdprasanth@gmail.com>
Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>
Co-authored-by: Prasanth Baskar <bupdprasanth@gmail.com>
Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>
@rizul2108

Copy link
Copy Markdown
Collaborator Author

output yaml/json is not working for view.

./habor-cli scanner list -o yaml doesn't return yaml output.

view cmd is fixed
and for list
image
it is yaml only i checked with a validator

implement changes

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

view-cmd terminal change fixed

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

lint fix

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

@bupd bupd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have left my suggestions for improvements. feel free to go through slowly and update the PR.

Comment thread cmd/harbor/root/scanner/create.go Outdated
Comment thread pkg/views/scanner/create/view.go Outdated
Comment thread pkg/views/scanner/create/view.go Outdated
Comment thread pkg/views/scanner/create/view.go
Comment thread cmd/harbor/root/scanner/delete.go Outdated
Comment thread cmd/harbor/root/scanner/metadata.go
Comment thread cmd/harbor/root/scanner/set_default.go
Comment thread cmd/harbor/root/scanner/update.go
Comment thread cmd/harbor/root/scanner/view.go Outdated
Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>
@Vad1mo Vad1mo changed the title Continuing Work from #109 : add scanner cmd Add scanner cmd Apr 29, 2025
rizul2108 added 2 commits May 6, 2025 07:31
2 changes implemented

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

fix create view

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

get scanners by name and fixes

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

improve desc and docs of cmds

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

small fix

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

small fixes in url

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

small fixes in url

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
@rizul2108 rizul2108 requested a review from bupd May 6, 2025 11:18

@bupd bupd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@bupd bupd added the enhancement New feature or request label May 6, 2025
@rizul2108

Copy link
Copy Markdown
Collaborator Author

@Vad1mo ready to merge

@Vad1mo

Vad1mo commented May 13, 2025

Copy link
Copy Markdown
Member

@rizul2108 Can you resolve the merge conflicts

Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
@Vad1mo Vad1mo merged commit 4ace830 into goharbor:main May 13, 2025
7 checks passed
@rizul2108 rizul2108 deleted the scanner-cmd branch May 14, 2025 18:48
rizul2108 added a commit to rizul2108/harbor-cli that referenced this pull request May 24, 2025
* Added `scanner create` command.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Improved the `scanner create` command. It tests the connection before the creation of the scanner.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Update pkg/api/scanner_handler.go

Co-authored-by: Aman <136564604+amands98@users.noreply.github.com>
Signed-off-by: Muazul Islam <96006730+muaz-32@users.noreply.github.com>

* Added the code review suggestions.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Added the `view` command for scanner.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Added the `metadata` command for scanner.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Added the `set-default` command for scanner.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Added the `delete` command for scanner.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Added the `update` command for scanner and fixed the `create` command for auth type.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* Added the `ping` option while creating scanner to mimic the web UI interaction.

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>

* add header and gofmt

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* add docs

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* lint fixes

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* lint fixes

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* update list cmd

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* add header

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* improve ui

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* fix lint issues

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* Update pkg/views/scanner/list/view.go

Co-authored-by: Prasanth Baskar <bupdprasanth@gmail.com>
Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>

* Update cmd/harbor/root/cmd.go

Co-authored-by: Prasanth Baskar <bupdprasanth@gmail.com>
Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>

* fix: implement changes and apply lint fixes

implement changes

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

view-cmd terminal change fixed

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

lint fix

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* implement changes and update docs

2 changes implemented

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

fix create view

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

get scanners by name and fixes

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

improve desc and docs of cmds

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

small fix

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

small fixes in url

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

small fixes in url

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

* small fix

Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>

---------

Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: Muazul Islam <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>
Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
Co-authored-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Co-authored-by: Aman <136564604+amands98@users.noreply.github.com>
Co-authored-by: Prasanth Baskar <bupdprasanth@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants