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 ping command #211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tylerauerbeck
Copy link
Contributor

Adds the ping command to check connectivity to the Harbor server

Signed-off-by: Tyler Auerbeck <[email protected]>
Comment on lines +26 to +41
func runPing() error {
ctx, client, err := utils.ContextWithClient()
if err != nil {
logrus.Errorf("failed to get client: %v", err)
return err
}

resp, err := client.Ping.GetPing(ctx, &ping.GetPingParams{})
if err != nil {
logrus.Errorf("failed to ping the server: %v", err)
return err
}

fmt.Printf("Ping: %s\n", resp.Payload)
return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

I suggest moving this to pkg/api/ping_handler.go. to maintain consistency with other commands.

@Vad1mo Vad1mo added invalid This doesn't seem right question Further information is requested and removed invalid This doesn't seem right labels Nov 26, 2024
@Vad1mo Vad1mo added the help wanted Extra attention is needed label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants