mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
add harbor network to adminserver
This commit is contained in:
parent
414e8a8bcf
commit
9f3f48be59
@ -56,6 +56,8 @@ services:
|
||||
volumes:
|
||||
- /data/config/:/etc/adminserver/
|
||||
- /data/secretkey:/etc/adminserver/key
|
||||
networks:
|
||||
- harbor
|
||||
depends_on:
|
||||
- log
|
||||
logging:
|
||||
|
@ -33,23 +33,13 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
issuer = "registry-token-issuer"
|
||||
defaultTokenExpiration = 30
|
||||
issuer = "registry-token-issuer"
|
||||
)
|
||||
|
||||
var expiration int //minutes
|
||||
var privateKey string
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
expiration, err = config.TokenExpiration()
|
||||
if err != nil {
|
||||
log.Errorf("failed to get token expiration: %v, will use the default value %d",
|
||||
err, defaultTokenExpiration)
|
||||
expiration = defaultTokenExpiration
|
||||
}
|
||||
privateKey = "/etc/ui/private_key.pem"
|
||||
log.Infof("token expiration: %d minutes", expiration)
|
||||
}
|
||||
|
||||
// GetResourceActions ...
|
||||
|
@ -14,9 +14,16 @@ import (
|
||||
"path"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/vmware/harbor/src/common/utils/log"
|
||||
"github.com/vmware/harbor/src/ui/config"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
if err := config.Init(); err != nil {
|
||||
log.Fatalf("failed to initialize configurations: %v", err)
|
||||
}
|
||||
|
||||
result := m.Run()
|
||||
if result != 0 {
|
||||
os.Exit(result)
|
||||
@ -73,7 +80,6 @@ func TestMakeToken(t *testing.T) {
|
||||
pk, crt := getKeyAndCertPath()
|
||||
//overwrite the config values for testing.
|
||||
privateKey = pk
|
||||
expiration = 10
|
||||
ra := []*token.ResourceActions{&token.ResourceActions{
|
||||
Type: "repository",
|
||||
Name: "10.117.4.142/notary-test/hello-world-2",
|
||||
|
Loading…
Reference in New Issue
Block a user