Skip to content

Commit

Permalink
GetQueueCreds func
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHuynh committed Sep 18, 2023
1 parent 0b0212b commit 0c54942
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vela/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package vela
import (
"errors"
"fmt"
"github.com/sirupsen/logrus"
"strings"

"github.com/go-vela/types"
Expand Down Expand Up @@ -254,3 +255,18 @@ func (svc *AdminWorkerService) RegisterToken(hostname string) (*library.Token, *

return t, resp, err
}

// GetQueueCreds fetches queue credentials based valid registration token.
func (svc *AdminWorkerService) GetQueueCreds() (*library.QueueRegistration, *Response, error) {

Check failure on line 260 in vela/admin.go

View workflow job for this annotation

GitHub Actions / diff-review

undefined: library.QueueRegistration

Check failure on line 260 in vela/admin.go

View workflow job for this annotation

GitHub Actions / diff-review

undefined: library.QueueRegistration

Check failure on line 260 in vela/admin.go

View workflow job for this annotation

GitHub Actions / full-review

undefined: library.QueueRegistration

Check failure on line 260 in vela/admin.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] vela/admin.go#L260

undefined: library.QueueRegistration
Raw output
vela/admin.go:260:58: undefined: library.QueueRegistration

// set the API endpoint path we send the request to
url := "/api/v1/queue-registration"

// library Token type we want to return
t := new(library.QueueRegistration)

Check failure on line 266 in vela/admin.go

View workflow job for this annotation

GitHub Actions / diff-review

undefined: library.QueueRegistration (typecheck)

Check failure on line 266 in vela/admin.go

View workflow job for this annotation

GitHub Actions / diff-review

undefined: library.QueueRegistration (typecheck)

Check failure on line 266 in vela/admin.go

View workflow job for this annotation

GitHub Actions / full-review

undefined: library.QueueRegistration (typecheck)

Check failure on line 266 in vela/admin.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] vela/admin.go#L266

undefined: library.QueueRegistration (typecheck)
Raw output
vela/admin.go:266:19: undefined: library.QueueRegistration (typecheck)
// Copyright (c) 2023 Target Brands, Inc. All rights reserved.

// send request using client
resp, err := svc.client.Call("POST", url, nil, t)
logrus.Infof(" Queue cred %v: ", t)
return t, resp, err
}

0 comments on commit 0c54942

Please sign in to comment.