From 18337461de835b74720441a1fe24ac6ba05b77f8 Mon Sep 17 00:00:00 2001 From: Alexander Dammeier Date: Mon, 7 Oct 2024 09:54:49 +0200 Subject: [PATCH] #81 replace simpleDoguName with the one from the lib --- pkg/adapter/config/kubernetes/doguConfigRepository.go | 2 +- pkg/adapter/config/kubernetes/sensitiveDoguConfigRepository.go | 2 +- pkg/domain/common/doguName.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/adapter/config/kubernetes/doguConfigRepository.go b/pkg/adapter/config/kubernetes/doguConfigRepository.go index ed22f82d..96d2bf0d 100644 --- a/pkg/adapter/config/kubernetes/doguConfigRepository.go +++ b/pkg/adapter/config/kubernetes/doguConfigRepository.go @@ -18,7 +18,7 @@ func NewDoguConfigRepository(repo repository.DoguConfigRepository) *DoguConfigRe func (e DoguConfigRepository) Get(ctx context.Context, doguName common.SimpleDoguName) (config.DoguConfig, error) { // TODO: There seems to be no way to know, if we have a NotFoundError or a connection error. - return e.repo.Get(ctx, config.SimpleDoguName(doguName)) + return e.repo.Get(ctx, doguName) } func (e DoguConfigRepository) Update(ctx context.Context, entry config.DoguConfig) (config.DoguConfig, error) { diff --git a/pkg/adapter/config/kubernetes/sensitiveDoguConfigRepository.go b/pkg/adapter/config/kubernetes/sensitiveDoguConfigRepository.go index 4139832c..40db469e 100644 --- a/pkg/adapter/config/kubernetes/sensitiveDoguConfigRepository.go +++ b/pkg/adapter/config/kubernetes/sensitiveDoguConfigRepository.go @@ -18,7 +18,7 @@ func NewSensitiveDoguConfigRepository(repo repository.DoguConfigRepository) *Sen func (e SensitiveDoguConfigRepository) Get(ctx context.Context, doguName common.SimpleDoguName) (config.DoguConfig, error) { // TODO: There seems to be no way to know, if we have a NotFoundError or a connection error. - return e.repo.Get(ctx, config.SimpleDoguName(doguName)) + return e.repo.Get(ctx, doguName) } func (e SensitiveDoguConfigRepository) Update(ctx context.Context, entry config.DoguConfig) (config.DoguConfig, error) { diff --git a/pkg/domain/common/doguName.go b/pkg/domain/common/doguName.go index 197ceb2b..a5d13244 100644 --- a/pkg/domain/common/doguName.go +++ b/pkg/domain/common/doguName.go @@ -3,6 +3,7 @@ package common import ( "errors" "fmt" + "github.com/cloudogu/k8s-registry-lib/config" "strings" ) @@ -12,7 +13,7 @@ type QualifiedDoguName struct { } type DoguNamespace string -type SimpleDoguName string +type SimpleDoguName = config.SimpleDoguName func NewQualifiedDoguName(namespace DoguNamespace, simpleName SimpleDoguName) (QualifiedDoguName, error) { doguName := QualifiedDoguName{Namespace: namespace, SimpleName: simpleName}