refactor: add context

This commit is contained in:
Kevin Franklin Kim 2024-05-09 14:11:47 +02:00
parent e04a6fb384
commit 7394d50521
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -175,5 +175,5 @@ func (c *Command) execute(ctx context.Context, r *readline.Readline) error {
u.User = url.UserPassword(username, password)
}
return browser.OpenURL(u)
return browser.OpenURL(ctx, u)
}

View File

@ -104,7 +104,7 @@ func (c *Command) Help(ctx context.Context, r *readline.Readline) string {
// ------------------------------------------------------------------------------------------------
func (c *Command) auth(ctx context.Context, r *readline.Readline) error {
return browser.OpenRawURL(c.harbor.Config().AuthURL)
return browser.OpenRawURL(ctx, c.harbor.Config().AuthURL)
}
func (c *Command) docker(ctx context.Context, r *readline.Readline) error {
@ -129,7 +129,7 @@ func (c *Command) docker(ctx context.Context, r *readline.Readline) error {
pterm.Info.Println("username: " + username)
pterm.Info.Println("please enter your CLI secret as password provided on your profile settings...")
_ = browser.OpenRawURL(c.harbor.Config().AuthURL)
_ = browser.OpenRawURL(ctx, c.harbor.Config().AuthURL)
return shell.New(ctx, c.l, "docker", "login", c.harbor.Config().URL, "-u", username).
Args(r.AdditionalArgs()...).