From 81e7b3b8eac6fd935e754ecceb8ad7bfca541e9d Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Thu, 7 Nov 2019 16:40:49 +0800 Subject: [PATCH] Add adapter pattern for helm hub adapter Add adapter pattern for helm hub adapter Signed-off-by: Wenkai Yin --- src/replication/adapter/helmhub/adapter.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/replication/adapter/helmhub/adapter.go b/src/replication/adapter/helmhub/adapter.go index e0d027d81..15077760a 100644 --- a/src/replication/adapter/helmhub/adapter.go +++ b/src/replication/adapter/helmhub/adapter.go @@ -16,6 +16,7 @@ package helmhub import ( "errors" + "github.com/goharbor/harbor/src/common/utils/log" adp "github.com/goharbor/harbor/src/replication/adapter" "github.com/goharbor/harbor/src/replication/model" @@ -39,7 +40,17 @@ func (f *factory) Create(r *model.Registry) (adp.Adapter, error) { // AdapterPattern ... func (f *factory) AdapterPattern() *model.AdapterPattern { - return nil + return &model.AdapterPattern{ + EndpointPattern: &model.EndpointPattern{ + EndpointType: model.EndpointPatternTypeFix, + Endpoints: []*model.Endpoint{ + { + Key: "hub.helm.sh", + Value: "https://hub.helm.sh", + }, + }, + }, + } } type adapter struct {